System and method for using context models to control operation of a mobile communications device

ABSTRACT

User activity on a mobile device is monitored and collected, and a resource usage model is constructed. The resource usage model describes a set of contexts in which the mobile device, and is the basis for determining a first exhaustion point for a resource. Based on the monitored activity, a prediction of a second exhaustion point for the resource time is made. If the second exhaustion point is prior to the first exhaustion point, usage of the resource is reduced.

CROSS-REFERENCE

This application is a continuation of pending U.S. application Ser. No.13/686,028 entitled System and Method for Developing, Updating, andUsing User and Device Behavioral Context Models to Modify User, Device,and Application State, Settings and Behavior for Enhanced User Security,which claimed priority from U.S. Provisional Application No. 61/719,233entitled System and Method for Developing, Updating, and Using User andDevice Behavioral Context Models to Modify User, Device, and ApplicationState, Settings and Behavior for Enhanced User Security, both of whichare incorporated by reference herein.

BACKGROUND

Portable electronic devices are typically powered by a battery. Thisallows the device to be used while not plugged into an electricaloutlet. One example of a portable electronic device is a mobile devicesuch as a smartphone or tablet computer. Mobile devices are becomingmore and more ubiquitous. About 490 million mobile devices were sold in2011. The number of mobile devices estimated to be in use by 2016 is 10billion.

People rely on their mobile devices to make and receive phone calls,stay up-to-date on the latest news, take pictures, record video, watchmovies, send and receive messages (e.g., email, or text messages), andmuch more. For example, many people use mobile application programs orapps for finding new places (e.g., mapping applications), socialnetworking, entertainment (e.g., playing games), banking, shopping,keeping track of appointments (e.g., calendaring), and generalproductivity—just to name a few examples. The reliance on mobile devicesis expected to grow exponentially.

These activities consume battery power. For example, battery power isconsumed when acquiring location (e.g., GPS coordinates), running anapplication, making a phone call, sending a text message, and so forth.It can be very frustrating to want to use your mobile device only tofind out that the battery is low or dead and you have no way of chargingthe device. For example, you may not be at home with your charger. Insome cases, the loss of battery power can even be life-threatening if,for example, you were unable to make an emergency phone call or activatean emergency alert. Thus, there is a need to develop systems andtechniques to intelligently manage mobile device battery use.

BRIEF SUMMARY OF THE INVENTION

In a specific implementation, a system and method are provided fordeveloping or modifying models of power consumption in devices poweredby batteries or other power storage mechanisms based on measurements,characteristics, and past and current usage histories of deviceapplications, sensors, communication mechanisms, component usage,available power sources, or current and anticipated locations.

In one embodiment a developed or modified model of power consumptioninformed by current and anticipated device state is used to alert adevice user about the current and projected state of power availability.Alternatively, the system can make suggestions to the user as to how tomodify the settings of the device, applications, sensors, communicationmechanisms, or components, or to turn them off to reduce powerconsumption. In another embodiment the model of power consumption andcurrent and anticipated device state is used to directly modify settingsfor the device, applications, sensors, communication mechanisms, orcomponents, or to turn them off.

In a specific implementation, systems and techniques are provided fordata security, resource usage, and context adaptation on a mobiledevice, specifically to collecting and analyzing context informationfrom a mobile device, developing behavioral context models andpredictions, and using them to modify the settings and behavior ofapplications and device components and to protect the security ofcontext information.

In another specific implementation, usage information associated with amobile device is collected. The collected information is used to build ausage model for a user of the mobile device that describes a set ofcontexts in which the mobile device is used. User activity on the deviceis monitored and the model is consulted to determine a first time afterwhich it will be acceptable for a battery of the mobile device to fallbelow a threshold charge level. Based on the monitored activity, aprediction of a second time is made for when the battery will fall belowthe threshold charge level. If the second time is before the first time,usage of the battery is reduced. If the second time is after the firsttime, usage of the battery is not reduced.

In a specific implementation, a method includes collecting behaviorinformation including a set of activities associated with usage of amobile communication device, analyzing the behavior information todetermine a first time after which it will be acceptable for a batteryof the mobile communication device to fall below a threshold chargelevel, examining current usage of the mobile communication device topredict a second time at which the battery will fall below the thresholdcharge level, and reducing usage of the battery if the second time is atleast a predetermined amount of time before the first time.

The behavior information may be collected by a server. The reducing theusage of the battery may include transmitting instructions from theserver to the mobile communication device to change a setting on themobile communication device from a first value to a second value, wherewhen the setting is at the second value less of the battery is consumedthan when the setting is at the first value.

The reducing the usage of the battery may include receiving at themobile communication device an instruction from a server to disable oneor more services on the mobile communication device. The method mayfurther include not reducing the usage of the battery if the second timeis a predetermined amount of time after the first time.

In a specific implementation, a method includes determining a first timeafter which it will be acceptable for a battery of a mobilecommunication device to fall below a threshold charge level, predictinga second time at which the battery will fall below the threshold chargelevel, and reducing usage of the battery if the second time is at leasta predetermined amount of time before the first time. The method mayfurther include not reducing the usage of the battery if the second timeis at least a predetermined amount of time after the first time.

The method may further include interpolating between a first data pointand a second data point to predict the second time, where the first datapoint corresponds to a first charge level of the battery that isrecorded at a third time, and the second data point corresponds to asecond charge level of the battery that is recorded at a fourth time.Reducing the usage of the battery may include automatically reducing theusage of the battery.

The method may include before the reducing the usage of the battery,prompting a user of the mobile communication device with a suggestion onhow to reduce the usage of the battery. The method may include beforethe reducing the usage of the battery, prompting a user of the mobilecommunication device for permission to reduce the usage of the battery.

In a specific implementation, reducing the usage of the battery includesat least one of dimming a brightness of a screen of the mobilecommunication device, disabling Wi-Fi network connectivity on the mobilecommunication device, disabling Bluetooth connectivity on the mobilecommunication device, starting an application on the mobilecommunication device, closing an application on the mobile communicationdevice, or disabling a global positioning system (GPS) receiver on themobile communication device. In an implementation, when the batteryfalls below the threshold charge level, the mobile communication deviceautomatically shuts down.

In a specific implementation, a method includes determining a first timeafter which it will be acceptable for a battery of a mobilecommunication device to fall below a threshold charge level, storing aset of data points, each data point corresponding to a specific chargelevel of the battery measured at a specific time, predicting, using thestored set of data points, a second time at which the battery will fallbelow the threshold charge level, determining that the second time is atleast a predetermined amount of time before the first time, and upon thedetermination, reducing usage of the battery.

Reducing the usage of the battery may include substituting servicesprovided by a first application program currently running on the mobilecommunication device with services provided by a second applicationprogram not currently running on the mobile communication device, wherethe second application program consumes less of the battery than thefirst application program.

Reducing the usage of the battery may include changing a setting of themobile communication device from a first value to a second value, wherewhen the setting is at the second value less of the battery is consumedthan when the setting is at the first value. In an implementation, themethod further includes before the reducing the usage of the battery,prompting a user of the mobile communication device to change a settingof the mobile communication device from a first value to a second value.

In an implementation, the method further includes before the reducingthe usage of the battery, prompting a user of the mobile communicationdevice for permission to change a setting of the mobile communicationdevice, receiving the permission, and upon receipt of the permission,changing the setting.

Reducing the usage of the battery may include storing a location of themobile communication device, intercepting a request from an applicationprogram for a current location of the mobile communication device,retrieving the stored location, and providing the stored location to theapplication program in response to the request, where the location ofthe mobile communication device is stored on the mobile communicationdevice before the intercepting the request from the application program.

In a specific implementation, a method includes the steps of on a mobilecommunications device having an activity monitor component, collectingby the activity monitor component behavioral information concerning aset of activities associated with usage of the mobile communicationsdevice, on the mobile communication device, analyzing the data collectedby the activity monitor component to estimate a first time when themobile communications device battery will fall below a predeterminedcharge level, on the mobile communication device, subsequent to theestimation of the first time, collecting by the activity monitorcomponent current usage information about the mobile communicationsdevice, on the mobile communications device, using the current usageinformation collected by the activity monitor component, estimating asecond time when the mobile communications device battery will fallbelow the predetermined charge level based upon current usage, and, ifthe estimated second time is a predetermined amount of time before thefirst estimated time, then employing an active policy manager on themobile communications device to implement active policies on the mobilecommunications device to reduce battery usage such that uponre-estimating in view of the implemented active policies, the estimatedsecond time is the same as or later than the estimated first time.

In a specific implementation, a method includes the steps of on a mobilecommunication device, determining an original battery glide pathprojection with a first battery exhaustion point, on the mobilecommunication device, at a time subsequent to the determination of theoriginal battery glide path projection, determining a current batteryglide path projection with a second battery exhaustion point, if thesecond battery exhaustion point is more than a predetermined amount oftime before the first battery exhaustion point, then, on the mobilecommunication device, employing an active policy manager to cause areduction in battery usage sufficient to allow a third batteryexhaustion point to occur at the same time or later than the firstexhaustion point.

In a specific implementation, a method includes the steps of on a mobilecommunications device, determining a first projected battery exhaustionpoint based upon information about the battery and about thethen-current state of the mobile communication device, on the mobilecommunication device, at a time subsequent to the determination of thefirst projected battery exhaustion point, determining a second projectedbattery exhaustion point based upon information about the battery andabout the then-current state of the mobile communication device, if thesecond battery exhaustion point is more than a predetermined amount oftime before the first battery exhaustion point, then, on the mobilecommunication device, employing an active policy manager to cause areduction in battery usage sufficient to allow a third batteryexhaustion point to occur at the same time or later than the firstexhaustion point.

BRIEF DESCRIPTION OF THE DRAWINGS

The present invention is illustrated by way of example and notlimitation in the figures of the accompanying drawings, in which likereferences indicate similar elements, and in which:

FIG. 1 shows a simplified block diagram of a specific embodiment of asystem for managing mobile device resources implemented in a distributedcomputing network connecting a server and clients.

FIG. 2 shows a more detailed diagram of an exemplary client of themobile device resource management system.

FIG. 3 shows a block diagram of a user interacting with a mobile devicehaving a resource manager of a resource prediction system.

FIG. 4 shows a block diagram of the resource prediction system and itssubsystems.

FIG. 5 shows a more detailed block diagram of the resource predictionsystem shown in FIG. 4.

FIG. 6 shows a block diagram of a mobile device and a management servicerunning on a server or in the cloud.

FIG. 7 shows a block diagram of a mobile device with a managementservice running on the mobile device.

FIG. 8 shows a block diagram of the Activity Store and its components.

FIG. 9 shows a block diagram of the Active State component.

FIG. 10 shows a diagram of a Resource Glide Path.

FIG. 11 shows a block diagram of a mobile device and a contextmanagement service running on a server or in the cloud.

FIG. 12 shows a block diagram of a mobile device with a contextmanagement service running on the mobile device.

FIG. 13 shows a block diagram of the Context Ontology with Resource andPolicy Semantics repository (CORPS).

FIG. 14 shows a block diagram of the Context History Store.

FIG. 15 shows a block diagram of the Active Context component.

FIG. 16 shows an example diagram of a fuzzy set membership function.

FIG. 17 shows a diagram of a Context Behavior Resource Glide Path.

FIG. 18 shows an example of an ontology.

FIG. 19 shows an overall flow for resource predictions.

FIG. 20 shows a flow for the Resource Glide Path.

FIG. 21 shows a block diagram of resource usage policies.

FIG. 22 shows a flow for providing cached location information.

DETAILED DESCRIPTION

FIG. 1 is a simplified block diagram of a distributed computer network100 incorporating a specific embodiment of a system for managingresource usage on a mobile device. Computer network 100 includes anumber of client systems 105, 110, and 115, and a server system 120coupled to a communication network 125 via a plurality of communicationlinks 130. Communication network 125 provides a mechanism for allowingthe various components of distributed network 100 to communicate andexchange information with each other.

Communication network 125 may itself be comprised of many interconnectedcomputer systems and communication links. Communication links 130 may behardwire links, optical links, satellite or other wirelesscommunications links, wave propagation links, or any other mechanismsfor communication of information. Various communication protocols may beused to facilitate communication between the various systems shown inFIG. 1. These communication protocols may include TCP/IP, HTTPprotocols, wireless application protocol (WAP), vendor-specificprotocols, customized protocols, Internet telephony, IP telephony,digital voice, voice over broadband (VoBB), broadband telephony, Voiceover IP (VoIP), public switched telephone network (PSTN), and others.While in one embodiment, communication network 125 is the Internet, inother embodiments, communication network 125 may be any suitablecommunication network including a local area network (LAN), a wide areanetwork (WAN), a wireless network, an intranet, a private network, apublic network, a switched network, and combinations of these, and thelike.

Distributed computer network 100 in FIG. 1 is merely illustrative of anembodiment and does not limit the scope of the systems and methods asrecited in the claims. One of ordinary skill in the art would recognizeother variations, modifications, and alternatives. For example, morethan one server system 120 may be connected to communication network125. As another example, a number of client systems 105, 110, and 115may be coupled to communication network 125 via an access provider (notshown) or via some other server system.

Client systems 105, 110, and 115 typically request information from aserver system which provides the information. Server systems bydefinition typically have more computing and storage capacity thanclient systems. However, a particular computer system may act as eithera client or a server depending on whether the computer system isrequesting or providing information. Aspects of the system may beembodied using a client-server environment or a cloud-cloud computingenvironment.

Server 120 is responsible for receiving information requests from clientsystems 105, 110, and 115, performing processing required to satisfy therequests, and for forwarding the results corresponding to the requestsback to the requesting client system. The processing required to satisfythe request may be performed by server system 120 or may alternativelybe delegated to other servers connected to communication network 125.

Client systems 105, 110, and 115 enable users to access and queryinformation or applications stored by server system 120. Some exampleclient systems include desktop computers, portable electronic devices(e.g., mobile communication devices, smartphones, tablet computers,laptops) such as the Samsung Galaxy Tab®, Google Nexus devices, AmazonKindle®, Kindle Fire®, Apple iPhone®, the Apple iPad®, MicrosoftSurface®, the Palm Pre™, or any device running the Apple iOS™, Android™OS, Google Chrome OS, Symbian OS®, Windows Mobile® OS, Windows Phone,BlackBerry OS, Embedded Linux, webOS, Palm OS® or Palm Web OS™.

In a specific embodiment, a “web browser” application executing on aclient system enables users to select, access, retrieve, or queryinformation and/or applications stored by server system 120. Examples ofweb browsers include the Android browser provided by Google, the Safari®browser provided by Apple, Amazon Silk® provided by Amazon, the OperaWeb browser provided by Opera Software, the BlackBerry® browser providedby Research In Motion, the Internet Explorer® and Internet ExplorerMobile browsers provided by Microsoft Corporation, the Firefox® andFirefox for Mobile browsers provided by Mozilla®, and others (e.g.,Google Chrome).

FIG. 2 shows an exemplary computer system such as a client system. In anembodiment, a user interfaces with the system through a client system,such as shown in FIG. 2. Mobile client communication or portableelectronic device 200 includes a display, screen, or monitor 205,housing 210, and input device 215. Housing 210 houses familiar computercomponents, some of which are not shown, such as a processor 220, memory225, battery 230, speaker, transceiver, antenna 235, microphone, ports,jacks, connectors, camera, input/output (I/O) controller, displayadapter, network interface, mass storage devices 240, and the like.

Input device 215 may also include a touchscreen (e.g., resistive,surface acoustic wave, capacitive sensing, infrared, optical imaging,dispersive signal, or acoustic pulse recognition), keyboard (e.g.,electronic keyboard or physical keyboard), buttons, switches, stylus, orcombinations of these.

Mass storage devices 240 may include flash and other nonvolatilesolid-state storage or solid-state drive (SSD), such as a flash drive,flash memory, or USB flash drive. Other examples of mass storage includemass disk drives, floppy disks, magnetic disks, optical disks,magneto-optical disks, fixed disks, hard disks, CD-ROMs, recordable CDs,DVDs, recordable DVDs (e.g., DVD-R, DVD+R, DVD-RW, DVD+RW, HD-DVD, orBlu-ray Disc), battery-backed-up volatile memory, tape storage, reader,and other similar media, and combinations of these.

The system may also be used with computer systems having differentconfigurations, e.g., with additional or fewer subsystems. For example,a computer system could include more than one processor (i.e., amultiprocessor system, which may permit parallel processing ofinformation) or a system may include a cache memory. The computer systemshown in FIG. 2 is but an example of a computer system suitable for use.Other configurations of subsystems suitable for use will be readilyapparent to one of ordinary skill in the art. For example, in a specificimplementation, the computing device is mobile communication device suchas a smartphone or tablet computer. Some specific examples ofsmartphones include the Droid Incredible and Google Nexus One, providedby HTC Corporation, the iPhone or iPad, both provided by Apple, and manyothers. The computing device may be a laptop or a netbook. In anotherspecific implementation, the computing device is a non-portablecomputing device such as a desktop computer or workstation.

A computer-implemented or computer-executable version of the programinstructions useful to practice the systems and techniques described inthis application may be embodied using, stored on, or associated withcomputer-readable medium. A computer-readable medium may include anymedium that participates in providing instructions to one or moreprocessors for execution. Such a medium may take many forms including,but not limited to, nonvolatile, volatile, and transmission media.Nonvolatile media includes, for example, flash memory, or optical ormagnetic disks. Volatile media includes static or dynamic memory, suchas cache memory or RAM. Transmission media includes coaxial cables,copper wire, fiber optic lines, and wires arranged in a bus.Transmission media can also take the form of electromagnetic, radiofrequency, acoustic, or light waves, such as those generated duringradio wave and infrared data communications.

For example, a binary, machine-executable version, of the softwareuseful to practice the techniques described in this application may bestored or reside in RAM or cache memory, or on mass storage device 240.The source code of this software may also be stored or reside on massstorage device 240 (e.g., flash drive, hard disk, magnetic disk, tape,or CD-ROM). As a further example, code useful for practicing thetechniques described in this application may be transmitted via wires,radio waves, or through a network such as the Internet. In anotherspecific embodiment, a computer program product including a variety ofsoftware program code to implement features described in thisapplication is provided.

Computer software products may be written in any of various suitableprogramming languages, such as C, C++, C#, Pascal, Fortran, Perl, Matlab(from MathWorks, www.mathworks.com), SAS, SPSS, JavaScript,CoffeeScript, Objective-C, Objective-J, Ruby, Python, Erlang, Lisp,Scala, Clojure, and Java. The computer software product may be anindependent application with data input and data display modules.Alternatively, the computer software products may be classes that may beinstantiated as distributed objects. The computer software products mayalso be component software such as Java Beans (from Oracle) orEnterprise Java Beans (EJB from Oracle).

An operating system for the system may be the Android operating system,iPhone OS (i.e., iOS), Windows Phone, Symbian, BlackBerry OS, Palm webOS, bada, Embedded Linux, MeeGo, Maemo, Limo, or Brew OS. Other examplesof operating systems include one of the Microsoft Windows family ofoperating systems (e.g., Windows 95, 98, Me, Windows NT, Windows 2000,Windows XP, Windows XP x64 Edition, Windows Vista, Windows 7, Windows 8,Windows CE, Windows Mobile, Windows Phone 7), Linux, HP-UX, UNIX, SunOS, Solaris, Mac OS X, Alpha OS, AIX, IRIX32, or IRIX64. Other operatingsystems may be used.

Furthermore, the computer may be connected to a network and mayinterface to other computers using this network. The network may be anintranet, internet, or the Internet, among others. The network may be awired network (e.g., using copper), telephone network, packet network,an optical network (e.g., using optical fiber), or a wireless network,or any combination of these. For example, data and other information maybe passed between the computer and components (or steps) of a systemuseful in practicing the systems and methods in this application using awireless network employing a protocol such as Wi-Fi (IEEE standards802.11, 802.11a, 802.11b, 802.11e, 802.11g, 802.11i, and 802.11n, justto name a few examples). For example, signals from a computer may betransferred, at least in part, wirelessly to components or othercomputers.

FIG. 3 shows a block diagram of a user 305 using a mobile communicationdevice 310. The mobile communication device includes a set of resourceconsumers 315, a resource 320, and a resource manager 325. A resourceconsumer can be any application program, function, setting, option,configuration, or hardware component that consumes a resource of themobile device. In a specific implementation, the resource includes abattery such as a lithium ion (Li-ion) rechargeable battery. Otherexamples of batteries include lead-acid, nickel cadmium (NiCd), nickelmetal hydride (NiMH), and lithium ion polymer (Li-ion polymer).

The resource manager is part of a resource prediction system 405 (seeFIG. 4) that uses contextual information to predict resource usage. Theresource manager helps to ensure judicious use of a resource so that theresource can be available when needed. More particularly, mobile deviceshave a variety of sensors that can sense information about the user andthe environment. These devices also have information on the state ofdevice components and resources such as batteries, communicationssystems, processors, cameras, audio input and output devices, and on thestate or configuration of applications installed or running on thedevice. Such information is referred to as contextual information.

It can be desirable to have applications and external services usecontextual information to adapt how applications operate, to obtainadditional information based on context for the user or forapplications, or to feed external services like social or advertisingnetworks.

Use of sensors and other sources of contextual information consumesresources on the device, such as energy from batteries, orcommunications bandwidth. Users of such devices have to cope withresource limits and resource exhaustion, such as network data usagelimits being exceeded or batteries being drained. It can be desirable tohave applications be context-aware and adapt their operation based onthe current state of resources or other contextual information. Usersand device administrators are not able to develop simple policies thatwork in all situations to conserve resources according to a user'scurrent context.

It is difficult for users to try to manually manage application andservice settings on the device to conserve resources for later use inthe day. Device profiles are inadequate because the large number andvariety of different contextual situations that users find themselves inwould require manually creating and frequently switching among a largenumber of device profiles.

As more applications and external services attempt to use devicecontextual information, there is some duplication of effort in obtainingand using contextual information. Different applications may not adapttheir operation in a consistent manner. Applications and externalservices may attempt to obtain and use contextual information in amanner that endangers the security or privacy of the user.

Even when applications are making good use of current contextualinformation, that may prove insufficient to help the device user achievea goal of making it through the day (in the case of a battery) orthrough the month (in the case of a data limit) with enough deviceresources still available to do perform all, or at least critical,tasks. What looks like a good contextual use of resources based oncurrent state and context at the time could lead to the later exhaustionof a resource when it is still needed; if future use of resources cannotbe predicted then it can be impossible for local contextual adaptationto be making good decisions for the longer time period.

Mobile device users report frequently having problems with battery life.Every operation on a mobile device uses some battery, from email togames, from social networks to business applications, from text messagesto phone calls. Mobile device users are annoyed and frustrated when theyare unable to use their device or its applications because a battery hasdied.

Previous attempts to address this problem such as task killer programs,battery savers, or profile switchers require frequent attention by theuser and address only a small part of the problem of managing resourceconsumption. For example, profile switcher programs require the mobiledevice user to develop and label a large number of profiles to attemptto cover normal everyday situations. Users tend to resist excessiveconfiguration of fine-grained controls. Battery saver programs lead toessential services being turned off just before they are actuallyneeded, because the current context state is not sufficient itself todetermine what will likely happen in the future.

FIG. 4 shows a simplified block diagram of a system 405 configured toprovide resource predictions. The features provided by the system may beimplemented using a set of subsystems having one or more modules. Themodules can be software modules (e.g., software instructions or code)executed by a processor, hardware modules, or combinations of these. Themodules (or a subset of the modules) can be part of a computer softwareproduct implemented as an independent application (e.g., mobileapplication program or app) with data input and data display modules. Inanother specific implementation, the system may be provided within anoperating system of the mobile device. In another specificimplementation, the system provides prediction as a service to otherapplications such as through an application programming interface (API)or web service.

In a specific implementation, the one or more modules are distributedacross a mobile device and a server system. Typically, a server has morecomputing resources than a mobile device. For example, a server may havemore storage, more memory, faster and more powerful processors, and willnot be dependent on a battery as a primary source of power as comparedto the mobile device. Thus, one advantage of a distributed system isthat processor intensive computing tasks such as those involving largedatasets, data mining, pattern discovery, correlations, and the like canbe performed on a server. The results of the server computations can betransmitted as instructions for the mobile device to follow and execute.

In another specific implementation, the modules are located on themobile device and the processing is performed at the mobile device. Anadvantage of this approach is that the mobile device does not have toconnect to the server system. For example, the mobile device may be inan area without network connectivity. However, the user will be providedthe benefits of the resource prediction system because the modules arelocated on the mobile device.

The system, as shown in the example of FIG. 4, a user data subsystem410, an intelligence subsystem 415, and a policy enforcement subsystem420. The user data subsystem includes collection and monitoring units425 to collect users' activity data related to usage of their mobiledevice. In one embodiment, the user data subsystem includes a usagemodel 430 that is created and stored for each user of the resourceprediction system. A usage model represents the system's understandingof how a user uses the mobile device including the context in which suchuse occurs and other information that can be used to predict future useof a resource (e.g., battery).

A context describes the conditions under which device usage, non-usage,or both occur. In a specific implementation, determining a currentcontext and predicting a subsequent or later context is used to managebattery usage during the current context so that the battery isavailable for the subsequent context.

In a specific implementation, context is used to automatically configurethe mobile device. For example, in this specific implementation, thesystem may determine that the current context includes the userattending a meeting in a meeting room at his work location. Based on thecurrent context, the system may automatically activate one or morepolicies that allow phone calls from family or emergency calls (e.g.,call is being placed from a hospital) but block other phone calls,disable mobile device sounds (e.g. chimes), close backgroundapplications, and disable location service. Determining context allowsthe system to discover what the user is currently doing, anticipate orpredict what the user is likely to do next, and configure the mobiledevice accordingly.

There can many different levels of context abstraction. For example, thecontext “commute to work” may be further detailed as “commute to work incar” or “commute to work on train.” These different levels ofabstraction allow the system to provide very fine-grained control foradapting device behavior. Context can include geographical locationinformation, applications used, time and date information, and otherinformation. Further discussion is provided below.

The intelligence subsystem is responsible for building and creating theusage models by analyzing the usage data collected by the collection andmonitoring units. The analysis can include pattern detection, event andactivity correlation, comparisons, and detecting deviations from typicaldevice usage. Based on the analysis, the intelligence subsystem makes aprediction about the resource.

An example of a prediction is that the resource, e.g., battery, willfall below a threshold charge level at a particular time. If theparticular time is before a time at which the battery is permitted tofall below the threshold charge level, the system takes actions to helpreduce usage of the battery. For example, in some cases it may be okayfor the battery to fall below the threshold charge level such as whenthe user is at home and has access to a charger. It is desirable tointelligently manage use of the battery—rather than simply disablingthings—because then the user can enjoy the full functionality of thedevice and accompanying applications and services.

In an implementation, reducing usage of a resource, such as a battery,is the responsibility of the policy enforcement subsystem. The policyenforcement subsystem activates and enforces resource usage policies onthe mobile device in order to help conserve a resource. Examples ofresource conservation actions include changing settings on the mobiledevice (e.g., changing or dimming a brightness setting of the screen,disabling local network connectivity such as Bluetooth), altering thefrequency of notifications, disabling a service, providing substituteservices that consume less of a resource, and many others. In animplementation, a policy can be activated automatically based on thecurrent context. That is, the policy can be activated without userintervention. In other implementations, the system seeks authorizationfrom the user before activating a policy.

FIG. 5 shows a more detailed block diagram of the resource predictionsystem shown in FIG. 4. As discussed above, user data subsystem 410 asshown in FIG. 4 includes usage model 430 that is created by theprediction system and stored for each user of the system. The usagemodel includes an activity store 505 that stores historical activitydata 510 and current activity data 515.

The system uses the historical activity data, and the current activitydata to build an expected context behavior model 520, and an actualcontext behavior model 525, respectively. The expected context behaviormodel represents a user's expected behavior. For example, the expectedcontext behavior model may include information that describes the user'sactivities on a typical day (e.g., weekday or weekend). The actualcontext behavior model represents the user's actual behavior. Forexample, the actual context behavior may include information thatdescribes the user's activities during a current time period. Thecurrent time period may extend to the last minute, last five minutes,last 10 minutes, last 15 minutes, last 30 minutes, last hour, last twohours, or any duration of time that has elapsed as measured from thecurrent time.

As shown in FIG. 5, intelligence subsystem 415 includes an analysisengine 530 and a context ontology 535. The analysis engine includes ausage model builder 540 and a comparison engine 545. The analysis enginemay be referred to as an activity knowledge discovery manager. Thecontext ontology includes a hierarchical arrangement of contexts. Acontext describes the conditions under which device usage, non-usage, orboth occur. The conditions can include time, date, location, speed(e.g., tracking the movement of the device), and other factors (e.g.,altitude, or temperature). For example, a portion of an ontology mayinclude Location>Personal-Location>Home>Has-Charger. FIG. 18 shows amore detailed diagram of an example of an ontology. The context ontologymay be referred to as the Context Ontology with Resource and PolicySemantics repository or CORPS. Further discussion of CORPS is providedbelow.

The model builder can act as a bridge between the context ontology andthe data collected in the activity store to build the expected andactual context behavior models. The model builder can use the contextontology to tag, categorize, organize, classify, or label the activitydata collected in the activity store.

The comparison engine can compare the actual context behavior model withthe expected context behavior model to determine any deviations. Forexample, a user's expected morning routine may include relatively littleuse of the mobile device, but the user's afternoon routine may includeheavy usage of the mobile device to, for example, make phone calls, runproductivity applications, check email, and so forth. Consider, however,that for a particular morning the user's actual usage of the mobiledevice deviates such that actual usage is higher than expected. Thehigher morning usage uses more battery power than expected according tothe expected context behavior model. Based on the higher than expectedusage in the morning, the system may make a prediction that the batterycharge level will not be sufficient for the user's afternoon routine. Inthis case, the system can activate resource reduction policies to helpensure that the battery charge level will be sufficient to support theuser's afternoon routine. For example, the system may disable a serviceon the mobile device in order to conserve battery power.

Alternatively, if the actual usage is as-expected the system can permitthe service to remain activated. Thus, the user can continue to enjoythe benefits of the service. If the actual usage is less than expected,the system can allow for increased usage of the battery. For example,the system may enable a service.

As shown in FIG. 5, policy enforcement subsystem 420 includes a resourcemanager 550, a policy server 555, and a policy repository 560. Thepolicy server includes a policy authoring module 565 and a policydeployment module 570. The policy authoring module provides an interfacesuch as a graphical user interface, programmatic interface, or boththrough which an administrator can create and edit policies. Thepolicies are stored in the policy repository. The policy repository maybe referred to as an active state. The policy deployment module isresponsible for transmitting policies to the mobile device. Policies maybe transmitted on an as-needed basis. This helps to conserve storageresources on the mobile device. Alternatively, policies may bepreinstalled on the mobile device so that they can be immediatelyavailable when needed.

In an implementation, the resource manager is a module on the mobiledevice that manages usage of a mobile device resource according to anactivated policy. The resource manager may be referred to as an activestate policy manger. Further discussion is provided below.

FIG. 6 shows a specific embodiment of the resource prediction system.According to the specific embodiment shown in FIG. 6, a mobile device600 has a collection of mobile device elements, which include aplurality of applications 602, the operating system 604, and resources606 used by the applications 602 and by the operating system 604.

Resources 606 include physical items like sensors or device components,or logical items like built-in services. Physical items can include butare not limited to batteries, processors, cameras, audio input or outputdevices, GPS devices, thermometer sensors, accelerometers, displayscreens or LED indicators, communications components like cellularcommunication chips, Wi-Fi communications chips, or batteries.

Logical items can include operating system software components orproperties of physical items such as monthly data usage limits. Someresources 606 are exhaustible resources; as they are used, theircapacity is reduced, and they can be exhausted. Examples includebatteries or network data limits.

Other resources 606, the operating system 604, and applications 602 canin their operation have an effect on an exhaustible resource. Theactions they take, their current state, and their configuration settingscan all have a different degree of effect on an exhaustible resource.

Not shown in the figure is the presence of virtual machine technologiesor device firmware logic. Firmware logic, which is conceptually belowthe level of the operating system, may have settings or operations whichcan be used in implementing policies. There can be a virtual machinelayer underneath the level of the operating system, which may havesettings or operations which can be used in implementing policies.Additionally, the operating system may have the ability to run virtualmachine applications, each of which would have the ability to run anoperating system and applications; any or all of these may have settingsor operations which can be used in implementing policies. There arenon-exhaustible resources which are nonetheless finite in some respect,such as memory or storage with respect to the number of bytes that canbe stored, or such as CPU with respect to the number of processor cyclesavailable in a given time interval. Any such non-exhaustible resourcewith a finite capacity can be modeled as a special kind of exhaustibleresource with regards to the use of active policies to reduce oroptimize resource utilization.

As discussed above, examples of the operating system 604 are the Androidoperating system used on various mobile devices, or the iOS operatingsystem used on iPhone or iPad devices. Reference to the operating system604 may also include its components or associated libraries, and any useof a virtualization mechanism which may be hosting and running theoperating system or applications.

There may be external environment resources 632 in the externalenvironment 630 which can include but are not limited to batterychargers, sensors, or services that can make information available toresources 606 or which can communicate with and be controlled byresources 606. External environment resources 632 are not properly partof the mobile device 600, although they may communicate with the mobiledevice 600 or may be sometimes connected to the mobile device 600.

An activity monitor 610 obtains information from applications 602, theoperating system 604, resources 606 (which may include informationobtained by resources 606 from external environment resources 632), orcombinations of these. Such information can include but is not limitedto application configuration settings, application current state oractivities for running applications, actual application binaries orportions thereof, information provided by the operating system about itscurrent state and settings, raw data information from the variousresources, or combinations of these. The operating system may mediateaccess to some or all of this information.

The activity monitor 610 in its monitoring may obtain the informationjust once, or may subsequently again obtain the information, which mayhave changed. Subsequent acts of obtaining information may occurperiodically, or may be driven by listening for changes in theinformation, or may be driven by requests or notifications from mobiledevice elements or the activity collector 652 or the active state policymanager 620 or 680. As an example, for a given time period, such as a24-hour time period, the activity monitor may make a single collectionof information or may make multiple collections of information.

The activity monitor 610 may store the information it obtains in a localactivity store 612. The activity monitor may read the information storedin the local activity store 612 for communication with the activitycollector 652, for communication with the active state policy manager620, or both.

An active state policy manager 620 reads information from or storesinformation into a local data store called the active state 622. Theactive state policy manager 620 queries or modifies the settings orstate of applications 602, the operating system 604, resources 606, orcombinations of these. The active state policy manager 620 may alsoquery or modify the settings or state of external environment resources632. The active state policy manager 620 communicates with the activestate policy manager 680 that is located in the server/cloud managementservice 650.

In one embodiment the active state policy manager 620 may modify anapplication 602 by embedding an executable policy into the application.

In another embodiment, the active state policy manager 620 maydynamically attach to an application 602, or to the operating system604, or to a resource 606, in memory to implement policy enforcement.

In another embodiment, cooperating applications 602 may have been linkedwith libraries (that front end various calls or messaging in theapplication which receive or send context information or which accessresources or the operating system) that communicate with the activestate policy manager 620 to obtain permissions for actions.

In an embodiment the active state policy manager 620, via modificationof or dynamic attachment to the applications 602, or the operatingsystem 604, or the resources 606, or a combination thereof, mediatesaccess from the applications 602 to context information available fromthe operating system 604 or the resources 606, providing its own versionof the information or selectively denying access to such information.Its own version of the information could include cached copies ofinformation previously retrieved, or information that has beenstandardized to hide details regarding the different models or types ofresources providing the information, or information that has beenmodified or had some information removed for privacy reasons.

In an embodiment the active state policy manager 620 may take action onthe mobile device elements (applications 602, operating system 604,resources 606). Actions can include starting an application, killing arunning application, disabling a resource, or modifying the currentstate or configuration settings of an application or the operatingsystem or resource. Actions can include the active state policy manager620 directly and automatically taking the actions, or prompting themobile device user for permission to take the actions, or suggesting tothe mobile device user that the user take specific actions.

The server/cloud management service 650 runs on a plurality of servers,and may be provisioned in the cloud. A server/cloud management service650 may communicate with multiple mobile devices 600.

The activity collector 652 communicates with the activity monitor 610which is running on the mobile device 600. The activity collectorreceives information that has been obtained by the activity monitor 610and stores it in the activity store 654 that is part of the server/cloudmanagement service 650.

The activity knowledge discovery manager 664 reads information from theactivity store 654 and using a variety of knowledge discovery in datatechniques, including clustering, data mining, and machine learningtechniques, discovers patterns of resource usage and creates resourcepredictions and writes them into the active state 666 store.

The active state policy manager 680 reads the information in the activestate 666, optionally updated with selected unprocessed information fromthe activity collector 652. The active state policy manager 680constructs, selects, or modifies policies and writes them to the activestate 666 store. The active state policy manager 680 on the server/cloudmanagement service 650 communicates information from the active state666 store to the active state policy manager 620 that runs on the mobiledevice 600.

The activity collector 652 informs the activity monitor 610 regardingwhat information to collect and what information to forward to theactivity collector 652. Some information may be monitored by theactivity monitor 610 that is not forwarded to the activity collector652.

Referring now to FIG. 7, a system is illustrated similar to the one inFIG. 6, but in which there is no server/cloud management service, ratherthe management parts reside on the mobile device 600.

In another embodiment, the mobile device 600 can run all the elements asshown in FIG. 7, but the activity monitor 610 and active state policymanager 620 can be in communication with an activity collector 652 andan active state policy manager 680, respectively, that are part of aserver/cloud management service 650. This is a hybrid embodiment inwhich the mobile device 600 can perform all the management activitiesbut locally, but may communicate with a server/cloud management service650.

Referring now to FIG. 8, the activity store 800 is illustrated ingreater detail. Information that identifies the specific instance of aresource (such as a serial number or other unique identifier, or themake or model or type of resource (such as brand and model number of abattery or processor or the name, software identifier [e.g., packagename], and version of an application and information about theapplication publisher [e.g., name, signing certificate]) is included inthe resource identifying information 806. Information that relates tothe resource settings and configuration 804 is also part of the activitystore 800; for an application this can include part or all of theapplication binary as installed on the mobile device 600 as well asconfiguration information for the application. The resource currentoperational state 808 includes those pieces of information such as, fora battery, whether it is currently charging or not, and what the currentlevel of charge is.

For resources that are themselves sensors, there can be a stream of raw(unprocessed) data from the resource; this is the resource raw data 802.The resource settings and configuration 804 also contains informationabout the format and precision of the resource raw data 802 that theresource can supply. In an embodiment the activity monitor 610 or theactivity knowledge discovery manager 664 may perform some processing onthe resource raw data 802 to summarize or distill or categorize it,augmenting the resource raw data 802 in the activity store 800.

For the purposes of the activity store 800, resources can also includeinformation obtained from external environment resources 632.

FIG. 9 illustrates the parts of the active state 900 store, which isrepresented as active state 622 and active state 666 in FIG. 6 and asactive state 622 in FIG. 7.

A policy template 902 is constructed by and written to the active state900 by the activity knowledge discovery manager 664, or can be manuallyauthored by an administrator. A policy template is set of conditions andpossible actions that can be taken on the mobile device 600 by employingthe active policy manager to modify the functioning of an application602 or the operating system 604 or a resource 606 or an externalenvironment resource 632. A policy template may also have associatedwith it qualitative or quantitative measures of the results that apolicy may have on resources.

For example, a policy template that changes the frequency that an emailapplication checks for new mail to once every ten minutes instead ofonce a minute may qualitatively specify results of lowered battery/powerusage, or may quantitatively specify results of reduced battery/powerusage of so many mAh saved per hour.

A policy template 902 can be expressed in a number of ways. In oneembodiment a policy template is a set of IF-THEN-ELSE rules which testproperties of the current device conditions and take actions which caninvolve modifying the settings or configurations or current state ofapplications or the operating system or resources on the mobile device600, or modifying the settings or configurations or current state ofother elements of the environment that are external to the mobile device600.

Using the example of a policy template that reduces the frequency ofchecking for email, this could be accomplished by modifying a setting inthe email application. The email application may have an API or otherinterface that allows for changing this setting. The email applicationmay store this setting in a configuration file, such that the settingcan be modified by altering the configuration file, potentiallyrequiring stopping and restarting the application to accomplish thechange in setting. The email application might not expose such asetting, but might use an account sync service provided by the operatingsystem, as in the Android operating system; in such a case the frequencyof checking for new email can be accomplished by turning off theautomatic sync operation, and periodically “waking it up” by turning itback on for a short period of time.

Other actions can involve sending notifications to the current user onthe same or a different device, or executing a named procedure from thepolicy manager to solicit user input or approval for a tentativedecision to take a particular action. In another embodiment a policycould be a piece of source code or executable code to be run on thedevice in the context of the device's policy manager. In anotherembodiment a policy could be a set of desired states or configurationsettings. A policy template 902 is called a template because it maycontain slots that can be filled by values from designated propertiesfrom the current device conditions by the active state policy manager620 or 680.

An active policy 904 is a policy that is constructed by the active statepolicy manager 620 or 680 optionally using policy templates 902. Anactive policy 904 represents a policy that the active state policymanager 620 may conditionally enforce on the mobile device 600. Variouspieces of information that are specific to a particular device or usermay be filled in when turning a policy template into an active policythat is to be running on a device. In a specific implementation, policytemplates are organized hierarchically. A higher-level policy templatemay define a high-level set of goals, such as reducing network trafficand resulting battery usage by reducing frequency of checking forupdates for new content. Hierarchically below this may be policytemplates for accomplishing the higher-level goal for specificapplications, e.g., an email application, Facebook, etc. Further downthe hierarchy may be policy templates that are device specific, e.g.,the policy template for reducing the frequency of checking for new mailin the Gmail application could be different on an Android device vs. onan iPhone. The expected results on resources associated with a policytemplate (and with an instantiated policy) are used to modify resourcepredictions.

The resource predictions 906 are constructed and written to the activestate 900 by the activity knowledge discovery manager 664. A resourceprediction 906 is based on information that has been gathered into theactivity store 612 or activity store 654. A resource prediction 906 is aprediction of what is likely to happen with respect to a resource overtime. This can include expected rates of resource usage, usual networklocations contacted, usual applications executed, and frequency ofcertain activities performed on the mobile device 600 by applications602 or the operating system 604 or resources 606.

An active resource prediction 908 is a specific instantiation of aresource prediction 906 corresponding to conditions pertaining on themobile device 600 at this point in time.

Turning now to FIG. 10, an example resource glide path 1000 is detailed.As shown in FIG. 10, the resource glide path is plotted on a Cartesiancoordinate plane having an x-axis and a y-axis. The x-axis representsresource capacity. The y-axis represents time. The resource glide path1000 is a property of a resource prediction 906, or an active resourceprediction 908.

There can be different resource glide path properties for differentresources 606 that exist on the mobile device 600. For example, theresource glide path 1000 could be for a battery resource. In that case,the resource capacity scale 1010 would represent the battery capacity,with 1.00 indicating a fully charged battery, and 0.00 indicating afully discharged battery. A resource glide path projection 1020 that isa property of a resource prediction 906 is a resource prediction glidepath; it represents a prediction of what is likely to happen in thefuture.

The original resource glide path projection 1020 represents a predictionthat had been initially created by the activity knowledge discoverymanager 664 and placed into the active state store 622 or 666. Theactive state policy manager 620 or 680 placed the resource predictioninto the active state 622 or 666 as an active resource prediction 908when it determined that the device conditions corresponded to thisresource prediction. An active resource prediction can be modified bythe active state policy manager while it is active according to changesin current device conditions.

For example, additional information is available having been gathered bythe activity monitor 610 on the mobile device 600. The actual resourceglide path 1040 represents the actual resource usage that was measuredon the mobile device 610. In this example, more of the resource had beenused than had been predicted; the glide path is below the originalresource glide path projection 1020.

The active state policy manager 620 has updated the resource glide path1000 accordingly with a new glide path projection from current time1050; the current time 1060 is 10:00 a.m. This projection shows acurrent projected resource exhaustion point 1070 occurring at about 4:00p.m. The original projected resource exhaustion point 1030 was at about9:00 p.m. This time was after the acceptable earliest resourceexhaustion point 1080, and thus was by definition, acceptable. But thenew exhaustion point occurs earlier.

An active policy 904 may take action because there is now a currentprojected resource exhaustion point 1070 that occurs sooner than theacceptable earliest resource exhaustion point 1080 which corresponds tothe user's anticipated arrival at the user's residence where the usercan charge the device battery.

The active policy manager can choose a plurality of active policytemplates which can be turned into active policies to run on the device.The choice uses the expected impact of the policy upon the resource todetermine which and how many active policies should be activated, andwhat settings they should be using. E.g., the active policy manager canselect the active policy templates with the largest anticipated impactson reducing resource usage, continuing to activate more active policytemplates until the aggregate impact on resource usage is low enough toallow the resource exhaustion point to occur at or after the acceptableearliest resource exhaustion point.

In a specific implementation, the system provides a reserve in aresource prediction. An example of a reserve is that the user may wantto guarantee that there is always enough resource (e.g., battery power)to be able to make a voice phone call of two minutes duration. Othertypes of reserves with respect to different user actions withindifferent user applications could also be present. The presence of oneor more reserves essentially raises the floor of a resource glide path.Rather than having a floor of resource capacity 0.00, the presence ofone or more reserves might raise the floor of resource capacity to 0.22.This affects the time position of resource exhaustion points, whichcorrespond now to places where the resource glide path will intersectthe resource floor (higher than 0.00 because of the reserve).

According to a specific embodiment shown in FIG. 11, a mobile device 600runs a plurality of applications 602, which are controlled by theoperating system 604, which supports use of resources 606 by theapplications 602.

An activity monitor 610 obtains information from applications 602, theoperating system 604, resources 606, or combinations of these. Theactivity monitor 610 in its monitoring may obtain the information justonce during a particular time period, or may subsequently again obtainthe information during the particular time period, which may havechanged. Subsequent acts of obtaining information may occurperiodically, or may be driven by listening for changes in theinformation, or may be driven by requests or notifications from mobiledevice elements or the activity collector 652 or the active contextpolicy manager 1120 or 1180.

The activity monitor 610 may store the information it obtains in a localactivity store 612. The activity monitor may read the information storedin the local activity store 612 for communication with the activitycollector 652, for communication with the active context policy manager1120, or both.

An active context policy manager 1120 reads information from or storesinformation into a local data store called the active context 1122. Theactive context policy manager 1120 queries or modifies the settings orstate of applications 602, the operating system 604, resources 606, orcombinations of these. The active context policy manager 1120communicates with the active context policy manager 1180 that is locatedin the server/cloud context management service 1150.

In one embodiment the active context policy manager 1120 may modify anapplication 602 by embedding an executable policy into the application.

In another embodiment, the active context policy manager 1120 maydynamically attach to an application 602, or to the operating system604, or to a resource 606, in memory to implement policy enforcement.

In another embodiment, cooperating applications 602 may have been linkedwith libraries (that front end various calls or messaging in theapplication which receive or send context information or which accessresources or the operating system) that communicate with the activecontext policy manager 1120 to obtain permissions for actions.

In an embodiment the active context policy manager 1120, viamodification of or dynamic attachment to the applications 602, or theoperating system 604, or the resources 606, or a combination thereof,mediates access from the applications 602 to context informationavailable from the operating system 604 or the resources 606, providingits own version of the information or selectively denying access to suchinformation. Its own version of the information could include cachedcopies of information previously retrieved, or information that has beenstandardized to hide details regarding the different models or types ofresources providing the information.

In an embodiment the active context policy manager 1120 may take actionon the mobile device elements (applications 602, operating system 604,resources 606). Actions can include starting an application, killing arunning application, disabling a resource, modifying the current stateor configuration settings of an application or the operating system orresource, or combinations of these. Actions can include the activecontext policy manager 1120 directly and automatically taking theactions, or prompting the mobile device user for permission to take theactions, or suggesting to the mobile device user that the user takespecific actions.

The server/cloud context management service 1150 runs on a plurality ofservers, and may be provisioned in the cloud. A server/cloud contextmanagement service 1150 may communicate with multiple mobile devices600.

The activity collector 652 communicates with the activity monitor 610which is running on the mobile device 600. The activity collectorreceives information that has been obtained by the activity monitor 610and stores it in the activity store 654 that is part of the server/cloudcontext management service 1150.

The CORPS 1170 is the Context Ontology with Resource and PolicySemantics repository. The CORPS 1170 contains knowledge about resources,their characteristics, the kinds and ranges of measurements that theycan be made, rules for how to transform resource raw data to low-levelor high-level contextual information, templates for possible policiesregarding data security, privacy, resource usage, or context adaptationfor applications, operating system components, or resources.

The CORPS 1170 contains knowledge about what are referred to as contextabstractions, specifically, context situations and context behaviors. Ingeneral the term context refers to any information that can be used todescribe the internal state of an entity, where an entity is a person,place, or object or part thereof that is considered relevant to anyinteraction between a user and applications, and the external state ofother entities or the environment, where environment refers to thecomputing environment of the device and its components and operatingsystem and applications as well as to the external physical environmentof the device and the user. This includes the user and the applicationsthemselves.

Some context information is measurable directly by sensors; this isreferred to as resource raw data, or low level data. Other contextinformation requires preprocessing of low-level data; the resultinginformation is a form of high level data. Context abstractions areconceptual formulations of specific types and values of contextualinformation. FIG. 18 shows a subset of the CORPS ontology that can beused for making context-based resource usage predictions.

A set of high level data categories with particular values for the highlevel data may be called a context situation. This feature may bereferred to as context-awareness. For example, a set of processedcontext information regarding device location over time may show thatthe device is moving at a speed of 2.5 miles per hour (mph). This set ofhigh-level data (which was generated by processing low-level positiondata over time) corresponds to a context situation, one that could beconceptually labeled as LOW-SPEED-MOTION.

A different set of high-level data from an accelerometer sensor on themobile device could after preprocessing be determined to represent thesmall shocks of feet hitting the ground at a regular pace of 1.5 timesper second, which corresponds to a normal pace of foot-ground impactswhen walking. This context situation could conceptually be labeled asTAKING-STEPS.

Note that neither of the two context situations above necessarilyimplies that the user is walking (moving on foot). In the former case,the user could be riding in a low speed conveyance and not walking. Inthe latter case, the user could be walking in place and not movinganywhere. If both context situations, LOW-SPEED-MOTION and TAKING-STEPSare occurring at the same instant in time, this likely represents ahigher level conceptual context situation WALKING. The WALKING contextsituation has fused information from multiple sources and represents aninference, or the result of a reasoning process on other contextsituations. All three context situations can be considered as active atthis point in time.

The manner in which conceptual context situations are related to eachother is an ontology. An ontology is a lattice of nodes corresponding toconcepts that have various properties or values, and in which nodes mayhave various relationships to other nodes; in this definition we use themathematical meaning of the term lattice. The use of the ontology allowsfor the economical composition of context situations that have differentlevels of granularity, or represent successively more complex orabstract context situations. Context situations are modeled in theontology according to their potential usefulness in other activities,such as defining policy rules for context adaptation, or for datasecurity or privacy enforcement. The ontology can be expressed using avariety of formats, such as OWL (Web Ontology Language) or KIF(Knowledge Interchange Format).

A context situation is something that is happening at a particular pointin time. Context information can change, which means that a givencontext situation may no longer be active or current because of thechange in context information, but a new context situation may now beactive or current. Multiple context situations can be active at anypoint in time, either because the context situations represent differentlevels of abstraction, or because they relate to different dimensions ofcontext, or because they are compositions of multiple concurrent contextsituations.

For example, the context situations COMMUTE and COMMUTE-TO-WORK andCOMMUTE-TO-WORK-FROM-HOME and COMMUTE-TO-WORK-FROM-HOME-VIA-BART (orTRAIN) may all be active at the same time, but they represent differentlevels of abstraction. The context situation USING-EMAIL-APP may beoccurring at the same time as all of these other context situations.More specific combinations of co-ocurring context situations can be madeexplicit and labeled to the extent that they are useful for policymanagement.

For example, if it were useful, the context situationUSING-EMAIL-APP-WHILE-COMMUTING-TO-WORK-FROM-HOME-VIA-BART could be madeexplicit. In general, the Context Manager decides how far to go inrecording information about combination context situations based on howfrequently they occur in the user and device history. A highly detailedcombination context situation that only has ever occurred once is notlikely to be useful in the future, and thus would not be explicitlyrepresented.

On the other hand, a highly detailed combination that occurs veryfrequently could be useful in making resource predictions. A sequence ofcontext situations is one form of what may be called a context behavior.The context behavior could involve major changes in context situation,such as the user leaving work, and then commuting home. This is asequence context behavior.

Another form of a context behavior is one in which there are multiplecontext situations involved, but a higher level context situation maystill be active throughout the entire context behavior. An example is acontext behavior in which the context situation AT-WORKPLACE is activefor eight hours, during which a variety of lower level contextsituations such as WALKING, MEETING, and TYPING occur. This is anaggregate context behavior.

Both context situations and context behaviors can have different levelsof abstraction, or different granularities of time resolution, and cancontain other sequences or context behaviors.

The context manager 1160 reads information from the activity store 654and is responsible for processing the resource raw data, settings,configurations, identifying information and operational state intohigher level context information. The context manager uses theinformation in the CORPS 1170 to perform its processing, and to populateinformation into the active context 1166 and the context history store1162.

The context knowledge discovery manager 1164 reads information from thecontext history store 1162 and using a variety of using a variety ofknowledge discovery in data techniques, including clustering, datamining, and machine learning techniques, discovers patterns of resourceusage and creates resource predictions, context situation predictions,and context behavior predictions and writes them into the contexthistory store 1162.

The active context policy manager 1180 reads the information in theactive context 1166, optionally updated with selected unprocessedinformation from the activity collector 652. The active context policymanager 1180 uses the information in the CORPS 1170, especially thepolicy templates, constructs, selects, or modifies policies and writesthem to the active context 1166. The active context policy manager 1180on the server/cloud context management service 1150 communicatesinformation from the active context 1166 to the active context policymanager 1120 that runs on the mobile device 600.

The activity collector 652 uses control information from the CORPS 1170to inform the activity monitor 610 regarding what information to collectand what information to forward to the activity collector 652. Someinformation may be monitored by the activity monitor 610 that is notforwarded to the activity collector 652.

In one embodiment an application 602 that is aware of the contextinfrastructure may provide candidate application-related policies to theactive context policy manager 1120. Doing so allows the application 602to be actively managed according to policy, whether that is a policyprovided by the application 602 itself, or new or modified policiesbeing managed by the active context policy manager 1120. Modificationsto policies can be made by mobile device users, or by suitablyauthorized administrators for the mobile device (such as enterpriseadministrators in a corporation or parents in a family), or by dynamicmodifications to active policies generated locally by the active contextpolicy manager 1120 or the remote active context policy manager 1180.

In another embodiment an application 602 that is aware of the contextinfrastructure may provide definitions of context situations or contextbehaviors that are of particular interest to the functioning of theapplication, and which are not already present within the CORPS 1170.Such applications can query current state represented in the activecontext 1122 or subscribe to notifications regarding the content in theactive context 1122 by making requests of the active context policymanager 1120.

In one embodiment the mobile device 600 is temporarily not incommunication with the server/cloud context management service 1150. Inthis embodiment the active context policy manager 1120 is updating theactive context 1122 directly using information from the activity monitor610. In a related embodiment, there is additionally a copy of thecontext manager 1160 running also on the mobile device 600, which uses asubset of the CORPS 1170, also residing on the mobile device 600. Thesubset is just that information related to CORPS 1170 information thatis known to be relevant to this particular mobile device, this user, andfrequent or predicted context situations and context behaviors for thisdevice and this user, together with associated policy templates. In thisembodiment the mobile device 600 continues to be capable of activemanagement of policies regarding context adaptation and contextinformation privacy and security.

Referring now to FIG. 12, we see a mobile device 600 that is running allthe elements of a context management service on the device itself.Specifically, there is a CORPS 1170, a context manager 1160, a contexthistory store 1162, a context knowledge discovery manager 1164. In thisconfiguration the context management service is capable of runningindefinitely on the mobile device without requiring communication withan external server or cloud-based context management service.

Referring now to FIG. 13, the elements of the CORPS 1300 are detailed.The CORPS 1170 is the Context Ontology with Resource and PolicySemantics repository. The CORPS 1300 contains knowledge about resources,their characteristics, the kinds and ranges of measurements that theycan make, rules for how to transform resource raw data to low-level orhigh-level contextual information, templates for possible policiesregarding data security, privacy, resource usage, or context adaptationfor applications, operating system components, or resources.

Specifically, the resource context elements 1302 contain informationabout how to transform or process resource raw data 802 from low leveldata into high level context data. The resource context elements cancontain references to specific methods contained within the contextmanager 1160 for performing the processing, or to external methods orservices for doing same, or can be self-contained mapping rules from lowlevel data onto high level context information. E.g., for a batterylevel, the low level resource raw data 802 might be for current batterycharging rate expressed in terms of mAh/min; the mapping to a high leveldata could be a set of ranges, specific to the model or type of battery,that map ranges of these values onto ranges designatedLOW-CHARGING-RATE, AVG-CHARGING-RATE, or HIGH-CHARGING-RATE.

The resource baseline information 1304 includes characteristics aboutthe resource that may have been externally measured elsewhere, butinform the context management process by providing quantitativestructural and behavioral characteristics of resources and byestablishing relationships between events on the device and resultantresource usage.

An example includes information about the measured discharge curve ofvoltage over time for a battery. Another includes information for howmuch battery charge is consumed for a unit level of operation of theresource, such as the amount of battery charge consumed for one CPUsecond, or the amount of battery charge consumed for a voice phone callof one minute duration. Another example includes the amount of networkbandwidth typically used for email push notifications or for a minute oflistening to an internet-based music service. Another example includesthe amount of battery charge consumed for one second of CPU processoractivity. Another example includes the amount of battery charge consumedin killing a specific application, or in starting a specificapplication, or in running a specific application for a defined periodof time.

The purpose of the resource baseline information 1304 is to make aconnection between system-level events or application-level events andunderlying resource usage. This information can be measured externallyto this system in a laboratory setting and imported into the CORPS 1300,or could be inferred using machine learning and statistical techniques,e.g., principal component analysis, by the context knowledge discoverymanager 1164 and stored into the CORPS 1300.

Any event that can happen on the mobile device 600 or in anythingrunning on the mobile device, including applications 602, the operatingsystem 604, resources 606, and the various elements of the system beingdescribed here, can be used to establish resource baseline information1304. In general the resource baseline information 1304 can be used tomodel explicit known or measured or analytically inferred functionaldependencies or effects on other quantities, such as power usage.

The resource baseline information 1304 allows the context manager toreason about some resource measurements (in the example above, a certainamount of CPU time expended, or a voice phone call of a given duration)to estimate other values, such as the amount of battery charge consumed.This capability is useful either when direct measurements of particularresources are not available or when it can be more cost effective to useindirect measurements for some resource types. Additionally, theresource baseline information 1304 can be employed by the contextknowledge discovery manager 1164 and by the active context policymanager 1120 or 1180. The potential costs and benefits of particularpolicies can be estimated in advance by the active context policymanager 1120 or 1180 by using this resource baseline information 1304.

The ontology of conceptual context situations 1306 is a lattice of nodesrepresenting context situations, with each context situation nodecontaining various properties for high level resource context elements.When higher level context situations are composed of lower level contextsituations, then properties may include values from constituent contextsituation's properties, or processed combinations of such values. Ahigher level context situation encompasses a time interval for itscontext situation that substantially overlaps the time intervals for itsconstituent context situations. If there is no overlap, but rather asequence, then a combination of such situations is termed a type ofcontext behavior rather than a higher level context situation.

In one embodiment, conceptual context situations 1306 are manuallyauthored into the CORPS 1300 as a form of expert knowledge.

In another embodiment, conceptual context situations 1306 areautomatically entered into the CORPS 1300 using a hierarchicalclustering method that creates a dendrogram over combinations ofresource context elements 1302. Each level of cluster is a contextsituation. In another embodiment a plurality of different hierarchicalclustering methods can be employed yielding not a single hierarchicaldendrogram, but rather a lattice.

In another embodiment, conceptual context situations 1306 are created bylooking at the complete set of all possible combinations of resourcecontext elements 1302. This is potentially a very large number ofsituations. The context manager 1160 may construct such conceptualcontext situations and promote them into the CORPS 1300 based on thehistory of context situations within the context history store 1162 thatoccur frequently or represent discovered association rules with highsupport and confidence.

In another embodiment, either of the two previous methods can be usedlooking not just at combinations of resource context elements 1302 butalso other lower level conceptual context situations 1306.

The ontology of conceptual context behaviors 1308 can be constructed insimilar manner to how conceptual context situations 1306 are created,either by manual authoring or by automated procedures within the contextmanager 1160 or the context knowledge discovery manager 1164. A contextbehavior is an ordered sequence or an unordered collection of contextsituations or other context behaviors which substantially overlap withthe time duration of the context behavior. Typically the constituentcontext situations or other behaviors both begin and end during the timeinterval of the containing context behavior. But a constituent contextsituation or other context behavior may begin prior to the beginning ofthe context behavior as long as it ends after the containing contextbehavior begins. Likewise, a constituent context situation or othercontext behavior may begin prior to the end of the containing contextbehavior but may end after the end of the containing context behavior.

An example of a higher level context situation is MORNING-AT-WORK. TheAT-WORKPLACE-LOCATION context situation may involve onlylocation-related resource context elements that indicate that the userand device are physically at the user's workplace location. The MORNINGcontext situation may involve only time-related resource contextelements that indicate that the time is in the range from 8 a.m. until10 a.m. The MORNING-AT-WORK situation can be defined as the combinationof the AT-WORKPLACE-LOCATION and MORNING context situations.

In one embodiment the rules for processing a resource context element1302 or for property values for a context situation can be defined as atype I fuzzy set. In the example above for clock time, the fuzzy setdefinition for the time property for the MORNING situation could be atrapezoidal fuzzy definition MORNING fuzzy set 1600 as shown in FIG. 16.In another embodiment the rule could use a type II fuzzy set.

In another embodiment there can be multiple mobile devices 600, eitherfor the same user in communication with the server/cloud contextmanagement service 1150. In this case there can be context situationsand context behaviors defined using information from a plurality of themobile devices 600 for the same user. These devices could include smartphones, tablets, or PCs, among others. There may be context informationavailable from one such device that could aid in the contextualmanagement of another such device.

In another embodiment there can be context situations or contextbehaviors defined using information from a collection of a plurality ofmobile devices from a plurality of users. These devices may share acommon piece of hardware, or a common current location, or have the sameapplication installed. This can especially be valuable for use in thecontext history store 1162 in conjunction with the operations of thecontext knowledge discovery manager 1164.

A policy template 1310 in the CORPS 1300 is policy constructed withrespect to context situations or context behaviors in the CORPS 1300. Apolicy can be enabled by a link to a particular context situation orcontext behavior. When such a context situation or context behavior isactive, the link indicates that the linked policy is to be used forcontext management on the mobile device. A policy template 1310 can beexpressed in a number of ways.

In one embodiment a policy template is a set of IF-THEN-ELSE rules whichtest properties or relationships of the current context situation andtake actions which can involve modifying the settings or configurationsor current state of applications or the operating system or resources onthe mobile device 600, or modifying the settings or configurations orcurrent state of other elements of the environment that are external tothe mobile device 600.

Other actions can involve sending notifications to the current user onthe same or a different device, or executing a named procedure from thepolicy manager to solicit user input or approval for a tentativedecision to take a particular action. Such notifications could be aninformational message to the user that the active context policy mangerhas taken an action, or could be a request for the user's permission totake an action, or could be a recommendation to the user that the usertake a particular action.

In another embodiment a policy could be a piece of source code orexecutable code to be run on the device in the context of the device'sactive context policy manager. In another embodiment a policy could be aset of desired states or configuration settings. In another embodiment apolicy could be a set of rules to be enforced on the device by theactive context policy manager; for example, the rules could involvewhich applications are allowed to execute, permissible settings forapplications, permissible sensors to be read, or files or databases tobe read from or written to, permissible network technologies or networkdestinations, or types of content allowed to be read from or transmittedaway from the device. Policy templates can have a purpose related toresource usage on the device, or related to security or privacyconsiderations. A policy template 1310 is called a template because itmay contain slots that can be filled by values from designatedproperties from the associated context situation or context behavior.

The ontology of external context 1312 is an ontology of concepts thatsupport reasoning about context elements, context situations, andcontext behaviors. Properties for nodes are things that are useful inreasoning about context, making distinctions, or in seeking outadditional information to enhance existing context information.Relationships for nodes may include “is-a” relationships (hypernymy,hyponomy), “part-of” relationships (meronymy), or other special purposerelationships. Thus the ontology of external context 1312 is an ontologyof the world (the parts of the world that are useful to be modeled forcontext interpretation and enhancement) and of services for contextenrichment.

For example, one piece of context information could be the globalpositioning system (GPS) coordinates of the mobile device's currentlocation expressed as latitude and longitude: 41.767575, −88.070217. Theontology of external context 1312 has a concept node for GPS-COORDINATE.One of the properties for this node is the information about an externalservice that provides enhanced context information when given a GPScoordinate. An example of enhanced information returned is an addresscorresponding to the GPS coordinates, and the name of the business orbuilding at that location. In this example, the service returns theinformation “Cinemark At Seven Bridges IMAX, 6500 Illinois 53,Woodridge, Ill.; (630) 663-8892; cinemark.com” for the given GPScoordinates. The information returned by a context-enhancement servicecould be in natural language text, or could be in structured data, e.g.,{businessName: “Cinemark At Seven Bridges IMAX”, address: “6500 Illinois53, Woodridge, Ill.”, phone: “(630) 663-8892”, website: “cinemark.com”}.

Another context-enhancement service registered as a value of theBUSINESS-CATEGORY-SERVICE property of the concept node labeled BUSINESScould be called with the information returned from the previouscontext-enhancement service call to obtain the business category“MOVIE-THEATER”. There is a corresponding concept node in the ontologyMOVIE-THEATER, inheriting properties from its parent concept nodePERFORMANCE-VENUE, which has several properties. One property is a linkto a policy template that was written to handle the actions that a userwould normally take in a performance venue, namely, to turn the phoneringer from normal ring to vibrate, and to turn off Wi-Fi and GPSservices to conserve battery.

The knowledge in the ontology of external context 1312 permits thesystem to understand more about the user and device's current context,and to obtain additional information to enhance that understanding. Thisenables policy actions such as automatically adjusting phone ringersettings and turning off certain network services to conserve batteryupon the user entering a movie theater, and to restore those settingsupon exiting the theater.

In another embodiment the ontology of external context 1312 may containinformation about certain external context services which are themselvesonly available and relevant in certain situations. For example, a userand the user's mobile device are in the AT-HOME situation. The user hasa television which is equipped with an external context service thatcommunicates via Wi-Fi or Bluetooth or other networking technology andprovides programming information about which television channel iscurrently being displayed on the television. This external contentservice can be used to obtain that information and to enrich the contextwith the expected duration of the program being viewed, or to enableapplications that are aware of the context management infrastructure tosupply so-called second screen added functionality (the termsecond-screen refers to a simultaneous although not necessarilycoordinated use of a mobile or other computing device while the user isattending to a broadcast or playback or on-demand display of an event ona television).

Additional context enrichment information about what content was beingpresented on those channels (show episode descriptions, episodeidentifiers, CCTV text transcripts of voice audio on the shows, actualaudio and/or images shown), and information about which related contentwas shown (promos, advertisements, etc.) can be used by second screenapplications to adapt to context, e.g., by serving other content oradvertising related to the content, or by connecting to social mediachannels related to the content.

Turning now to FIG. 14, the details of the context history store 1400are shown. The context situation history 1402 is a history ofsubstantially every occurrence of each context situation that hasoccurred on the mobile device 600. Each occurrence is timestamped withthe beginning and end of the context situation. The properties of eachcontext situation instance are filled with the values that existed atthe time of the occurrence. In one embodiment the older occurrences ofcontext situations may be purged either periodically, or upon request,or substantially similar context situations may be summarized orcounted, or based on space available for the storage of the contextsituation history.

In some cases a property value in the context situation history 1402 isitself multi-valued, a time series of the different values of theproperty's value during the life of the situation.

One purpose of tracking context situation history 1402 is to be able toidentify frequently occurring context situations that represent anopportunity for manually or programmatically authoring new or modifiedpolicy templates to deal with the context situation.

Another purpose in tracking context situation history 1402 is to allowvarious data mining activities of the context knowledge discoverymanager 1164 to find clusters or patterns for creating new higher levelcontext situation or context behavior definitions into the CORPS 1170 orto discover association rules with high confidence and support that canbe used for predicting resource usage during context situations (contextsituation predictions 1410 or contributions to resource predictions1408), or for predicting ordered sequences of context situations orunordered collections of co-occurring situations that can constitute anew context behavior definition to be promoted into the CORPS 1170.

Context behavior history 1404 is similar to context situation history1402 except that it deals with the processing of historical occurrencesof context behaviors.

Policy execution history 1406 is tracked not just for audit andreporting purposes, but also includes tracking of the results andeffectiveness of policy execution, especially in terms of resourcesconserved by active context management. This information is also aninput to the context knowledge discovery manager 1164 and to the activecontext policy manager 1180 or 1120 to assist in the evaluation ofexisting policies and the generation of new policies.

Resource predictions 1408 are constructed and written to the contexthistory store 1162 by the context knowledge discovery manager 1164, andare based on aggregate statistics across context situation histories fora user's mobile device. A resource prediction 1408 is a prediction ofwhat is likely to happen with respect to a resource over time. This caninclude expected rates of resource usage, usual network locationscontacted, usual applications executed, and frequency of certainactivities performed on the mobile device 600 by applications 602 or theoperating system 604 or resources 606. These can be important in contextmanagement when novel situations are encountered.

Context situation predictions 1410 are predictions of what happenswithin the duration of a context situation. This can include expectedrates of resource usage, usual network locations contacted, and usualapplications executed, among other things.

Context behavior predictions 1412 are predictions regarding sequences ofconstituent context situation transitions, or frequencies ofco-occurrence of unordered collections of constituent contextsituations. Context behavior predictions in high level context behaviorsare useful for characterizing such things as the typical workdaylifecycle. An important part of prediction is a glide path for resourceutilization with respect to a large time granularity context behavior.Context behavior history provides predictions of resource usage when theuser is in a particular context behavior; if a user is currently usingmore resource than typical for a given context behavior (below the glidepath) it can be a trigger point for a policy to enforce stricterresource conservation efforts, either automatically, or with theinformed consent of the user.

Referring now to FIG. 15, the details of the active context 1500 areillustrated. The active context 1500 refers to either the active context1166 which resides in the server/cloud context management service 1150or the active context 1122 which resides in the mobile device 100. Thecontext manager 1160 is responsible for placing context situations,context behaviors, policies, resource predictions, context situationpredictions, and context behavior predictions into the active context1122, based on the information in the activity store 154 and the CORPS1170.

Active context situations 1502 are the specific instantiations ofconceptual context situations, corresponding to context situations thatare currently occurring. An active context situation 1502 is aconceptual context situation structure, with values for properties thatcorrespond to the current state of the context elements derived fromresources, applications, or the operating system on a particular mobiledevice, or of the context elements associated with the externalenvironment of the device, and of any other constituent active contextsituations 1502.

An active context situation 1502 is marked as active when it is placedinto the active context 1500; and when such a context situation ends, itis marked as inactive and may be removed from the active context 1500.In an embodiment, an active context situation 1502 marked as inactive isallowed to remain in the active context 1500 for a configurable amountof time before being removed, or to facilitate processing related toactive context behaviors 1504.

Active context situations 1502 which are higher level context situationscomprising multiple other context situations are linked together in theactive context 1500.

Multiple context situations related to a user or a mobile device 600 canbe active at a single point in time.

Active context behaviors 1504 are the specific instantiations ofconceptual context behaviors, corresponding to context behaviors thatare currently occurring. An active context behavior 1504 is a conceptualcontext behavior structure, with values for properties that correspondto the current state of the context elements derived from resources,applications, or the operating system on a particular mobile device, andof the context elements derived from the external environment of thedevice, and of any other constituent active context situations 1502 oractive context behaviors 1504.

An active context behavior 1504 is marked as active when it is placedinto the active context 1500; and when such a context behavior ends, itis marked as inactive and may be removed from the active context 1500.In an embodiment, an active context behavior 1504 marked as inactive isallowed to remain in the active context 1500 for a configurable amountof time before being removed, or to facilitate processing related toother parent active context behaviors 1504, and because the verydefinition of a context behavior may be such that it is only the passingof time without the occurrence of potentially constituent situationsthat defines the end of the context behavior.

Active context behaviors 1504 which are higher level context behaviorscomprising multiple other context behaviors are linked together in theactive context 1000.

Active policies 1506 are policies that are currently enabled for runningon the mobile device 600, controlled by the device's active contextpolicy manager 1120. An active policy is linked to one or more activecontext situations 1502 or active context behaviors 1504. The activecontext policy manager 1180 running on the server/cloud contextmanagement service 1150 communicates active policies 1506 from theactive context 1166 to the active context policy manager 1120 running onthe mobile device 600, where they are in turn stored in the device-sideactive context 1122.

Active resource predictions 1508 are resource predictions 1408 takenfrom the context history store 1400 when the mobile device 600 beingmanaged has the applicable resources on it. These resource predictionsare aggregate ones that can be used when novel situations or behaviorsare encountered that do not have associated situation predictions orbehavior predictions.

Active context situation predictions 1510 are placed into the activecontext 1166 by the context manager 1160 when a corresponding activecontext situation has been placed into the active context 1166.

Active context behavior predictions 1512 are placed into the activecontext 1166 by the context manager 1160 when a corresponding activecontext behavior has been placed into the active context 1166.

Referring now to FIG. 16, an illustration is made of the MORNING FuzzySet 1600, which is an example of how a resource context element 1302 canbe processed from raw, low level data into a higher levelrepresentation. The fuzzy set membership function 1610 represents how aresource context element for time of day corresponds to the higher levelcontext representation MORNING. This is standard type I fuzzy settechnology. In an embodiment type II fuzzy sets can also be used.

Turning now to FIG. 17, an example context behavior resource glide path1700 is detailed. The context behavior resource glide path is a propertyof a context behavior prediction. There can be multiple context behaviorpredictions that are active at any point in time; these may have anassociated estimated probability or likelihood.

One such context behavior prediction could be designated as the bestcase prediction, where best case means in terms of minimal resourceusage. Another such context behavior prediction could be designated theworst case prediction, where worst case means in terms of the largestexpected resource usage. Another such context behavior prediction couldbe designated as the most likely case prediction, where most likely caseis based on the statistical analysis of historical context behaviors.There can be different context behavior glide path properties fordifferent resources 606 that exist on the mobile device 600.

For example, the context behavior resource glide path trajectory 1720could be for a battery resource. In that case, the resource capacityscale 1710 would represent the battery capacity, with 1.00 indicating afully charged battery, and 0.00 indicating a fully discharged battery. Acontext behavior resource glide path trajectory 1720 that is a propertyof a context behavior history 1404 is a context behavior history glidepath; it represents what has happened in the past. A context behaviorresource glide path trajectory 1720 that is a property of a contextbehavior prediction 1412 is a context behavior prediction glide path; itrepresents a prediction of what is likely to happen in the future.

The context behavior resource glide path trajectory 1720 represents aprediction that had been initially created by the context knowledgediscovery manager 1164 and placed into the context history store 1162.The context manager 1160 placed the context behavior prediction into theactive context 1166 when the corresponding context behavior was placedthere. An active prediction can be modified while active according tochanges in current context.

For example, additional information is available having been gathered bythe activity monitor 610 on the mobile device 600. The actual resourceglide path 1740 represents the actual resource usage that was measuredon the mobile device 610. In this example, more of the resource had beenused than had been predicted; the glide path is below the contextbehavior prediction glide path trajectory 1720. The context manager 1160has updated the resource glide path 1700 accordingly with a glide pathprojection from current time 1750; current time 1760 is noon. Thisprojection shows a projected resource exhaustion point 1770 occurring atabout 5:30 p.m. An active policy 1506 associated with this activebehavior 1504 may take action because there is now a projected resourceexhaustion point 1770 that occurs sooner than the acceptable earliestresource exhaustion point 1780, which corresponds to the user'santicipated arrival at the user's residence where the user can chargethe device battery.

In an embodiment the context manager 1160 can observe additional contextinformation related to planned future events (such as calendarappointments) and use that information to modify a behavior predictionand its associated behavior resource glide path. For example, a futurecalendar appointment may indicate that the user's time away from theHOME context situation (where there known to be a battery chargeravailable) may be extended, and to adjust the context behavior resourceglide path accordingly. In this embodiment, a special type of activecontext situation 1502 can be entered into the active context 1166,representing a planned future context situation. This could lead to thecreation of a new context behavior that encompasses the existing WORKDAYcontext behavior, and contains the modified context behavior resourceglide path.

In another embodiment the context manager 1160 can take into accountuser or administrator provided context information related to potentialfuture events (such as phone calls) and use that information to modify acontext behavior prediction and its associated context behavior resourceglide path.

For example, a parent who is an administrator for a child's mobiledevice may specify that all context behavior planning needs to plan forhaving enough resources to make an emergency phone call, even thoughthat occurrence may not occur frequently or ever in context behaviorhistory. The emergency reserve for a specific number of specific typesof resource consuming actions adjusts the context behavior resourceglide path property of the context behavior, effectively raising thefloor to which the policy manager will ever allow the resource capacityto fall before taking a mitigation action. There is an advantage interms of either specifying types of reserves or in a user'sunderstanding of reserve provisions in a policy to being able to expressthem with respect to higher level user actions (such as “make a phonecall”) versus lower level resource specific criteria (such as “maintainat least 8 percent battery charge”).

An example of a policy's mitigation actions is when the active contextpolicy manager, understanding that there is barely enough batterycapacity left to make an emergency phone call, shuts off all otherservices on the phone (including music player applications, SMS texting,Wi-Fi network connections, and game applications), and notifies thechild user what has happened and why.

In another embodiment context behavior resource glide paths (historicalor predicted) can be represented by type I or type II fuzzy sets. Atraditional defuzzification process can be used to convert these to anormal context behavior resource glide path; but the richer amount ofinformation represented using fuzzy sets allows for policies to use moresophisticated mechanisms for resource shortage mitigation.

Policy templates stored in the CORPS can be viewed and edited bysuitably authorized users or other designated policy administrators, byon-device user interfaces controlled by the active context policymanager 1120 or via web user interfaces controlled by the active contextpolicy manager 1180. An advantage of this system is that it enables thecomposition and simultaneous enforcement of policies from administratorsand users in a manner consistent with the aims of both and enables aconsistent approach to resource and policy management across all appswhether they are aware of the context management infrastructure or not.It also allows for the contextual enforcement of security and privacypolicies regarding the access to or use of context information.

In another embodiment the active context policy manager 1180 can takeadvantage of the fact that the server/cloud context management service1150 manages context and policies for very many devices used by manyusers. In this embodiment the active context policy manager 1180 can useevolutionary computation/genetic algorithm techniques to explore thespace of possible policy variants in search of optimal effectiveness.

When a context situation or context behavior is observed in the contexthistory store 1162 to be common across many devices and users by theactive context policy manager 1180, the policy manager can choose togenerate several possible policy templates 1310 for the same situation,using the usual genetic algorithm techniques of mutation and crossoveroperators. The active context policy manager 1180 can select differentvariations of a policy for deployment into the active context 1166 fordifferent devices or users.

Subsequent analysis of the effectiveness of each policy using the policyexecution history 1406 in the context history store 1400 with respect toresource conservation or other metrics provides the evaluationfunction/fitness function that genetic algorithms use to further evolvevariations on solutions. Successful policies can then be evolved inanother generation. In this embodiment the policies for all users becomemore effective over time because of the ongoing optimization processinvolved in generating policy variants. Examples of policy variationscan include adjusting resource settings earlier or later, or usingresource settings that are more or less conservative, or using usernotifications instead of taking direct actions by the policy manager.

Some examples of the many items of activity information, which arerelated to resources, applications, or the operating system on a mobiledevice, that an activity monitor can collect are listed below:

Current state of device or components or applications or other connecteddevices:

-   -   Current system reported battery level (0 percent to 100 percent)        for each battery currently connected    -   Current settings of battery (including battery saver or        performance modes) for each battery currently connected    -   Current state of battery charging (e.g., currently being charged        by a battery charger or other external power source, or not        currently being charged) for each battery currently connected    -   Current power availability state of any external power source        connected to device but not being used for battery charging,        such as external battery, fuel cell, solar cell, or other power        source, measured in mAh (milli Amp hours) or in Wh (Watt hours)    -   Current other internal state of any external power source        connected to device, such as external battery level, fuel cell        current butane level, solar cell measured ambient light level,        current power level being generated by mechanical means (e.g.,        power harvesting technology from walking or bicycling or other        user motion using piezoelectric or other devices), or other        power sources,    -   System reported battery level (0 percent to 100 percent) at the        time of power-related events for each battery currently        connected; power-related events include among other things the        beginning of a battery charging event, the end of a battery        charging event, a device power on event, a device power off        event, a detection of a switch in battery identifier,    -   System reported battery level (0 percent to 100 percent) at the        time of power-related events for each battery currently        connected    -   Time elapsed since various power-related events for each battery        currently connected    -   Measured battery charging during last charging event (e.g.,        measured in mAh (milli Amp hours) or in Wh (Watt hours) or by        Coulomb counting or other methods) for each battery currently        connected    -   Measured battery usage since last charging event or device power        on event (e.g., measured in mAh (milli Amp hours) or in Wh (Watt        hours) or by Coulomb counting or other methods) for each battery        currently connected    -   Identification of battery or battery type or model for each        battery currently or previously connected    -   Elapsed time since manufacture of battery (age of battery) for        each battery currently or previously connected    -   Elapsed total time battery has been on while not charging, for        each battery currently or previously connected, since the        manufacture of battery or since the last charging event or since        the last device power on event    -   Elapsed total time battery has been on while charging, for each        battery currently or previously connected, since the manufacture        of battery or since the last charging event or since the last        device power on event    -   Number of charging events for battery, for each battery        currently or previously connected    -   Current operational status of battery charging capability, i.e.,        able to charge using external power source, or unable to charge        (e.g., due to charging system failure) for each battery        currently or previously connected    -   Current internal device temperature, humidity, or moisture        levels; this includes sensor values for the device itself and        for device components such as processors    -   Current external or ambient temperature or humidity; this        includes external or ambient values from sensors on the device,        as well as inferred external temperatures using device location        and temperature or humidity values for weather stations nearby        the device location    -   Average, minimum, and maximum internal device-related        temperatures since the occurrence of various power-related        events    -   Average, minimum, and maximum external or ambient temperatures        since the occurrence of various power-related events    -   Current power draw by device (e.g., measured in mAh (milli Amp        hours) or in Wh (Watt hours) or by Coulomb counting or other        methods)    -   Identification of each CPU or associated or auxiliary processor        (such as GPUs or cryptographic processors), or processor type or        model for each processor that is part of or attached to the        device    -   Elapsed CPU time since last power on event or last charging        event, for each CPU in device (including any associated        processors such as GPUs or cryptographic processors)    -   Normal rated frequency of operation for each processor that is        part of or attached to the device (including any associated        processors such as GPUs or cryptographic processors)    -   Current operating frequency of operation for each processor that        is part of or attached to the device (including any associated        processors such as GPUs or cryptographic processors)    -   Currently activated CPU power preserving modes for each        processor that is part of or attached to the device (such as        Intel SpeedStep or AMD PowerNow!)    -   Potentially available CPU power preserving modes for each        processor that is part of or attached to the device (such as        Intel SpeedStep or AMD PowerNow!)    -   Identification of communication devices or components, or type        of communications device or component (such as radios, Wi-Fi,        GPS, Bluetooth, NFC, GSM, CDMA, 3G, LTE, 2G, and others, or for        optical communications such as infrared or visible light        communications, or for audio communication such as powering        internal or external speakers or microphones, or for quantum        communications), or model for each communication device or        component that is part of or connected to the device,    -   Current external communication state (such as on or off or in        any of several operating modes such as standby, power-preserving        mode) and settings, such as signal strength, elapsed time        communication has been used, measured power consumption for        communication, for each communication type and technology, such        as for radiofrequency communications such as Wi-Fi, GPS,        Bluetooth, NFC, GSM, CDMA, 3G, LTE, 2G, and others, or for        optical communications such as infrared or visible light        communications, or for audio communication such as powering        internal or external speakers or microphones, or for quantum        communications, and which communications protocols have been in        use, and measurements of the amount of communication such as        bytes sent, bytes received, number of communications initiated        or responded to.    -   Identification of display(s) or display type (e.g., LCD or OLED        or electronic ink, or projection display, among others) or model        for each display that is part of or connected to the device,    -   Current display settings (including brightness level,        auto-brightness setting, positive vs. negative mode, contrast        level) for each display that is part of or connected to the        device,    -   Elapsed time that each display has been on, since last charging        event end or most recent device power on event, for each display        that is part of or connected to the device    -   Measured energy usage since last charging event end or most        recent device power on event, for each display that is part of        or connected to the device    -   Identification of audio output or input devices or type or model        for each audio output or input device that is part of or        connected to the device    -   Current audio output or input settings (including volume level,        microphone sensitivity) for each audio output or input device        that is part of or connected to the device    -   Elapsed time that each audio output or input device has been on        since last charging event or device power on event or other time        or event, for each audio output or input device that is part of        or connected to the device    -   Measured energy usage since last charging event end or most        recent device power on event, for each audio output or input        device that is part of or connected to the device    -   Identification of sensors (such as accelerometers, compasses,        temperature sensors, barometric pressure sensors, altitude        sensors, humidity sensors, moisture sensors, touch or pressure        sensors, orientation sensors, cameras, scanning devices,        proximity sensors, gyroscopes, ambient light sensors, chemical        or odor sensors, biometric input sensors, or medically related        sensors such as heartbeat, respiration, blood pressure, blood        oxygen levels using for example pulse oximetry, EEG sensors        including low level frequency and amplitude measurements or        derived information regarding the presence or strength of wave        patterns such as Delta, Theta, Alpha, Beta, Gamma, or Mu, or        tDCS or TMS sensors or ECG sensors) or sensors related to a        device user's gaze direction or sensor types or models for each        sensor that is part of or connected to the device    -   Current sensor state (on, off, performance mode) and settings        for each sensor that is part of or connected to the device    -   Elapsed time that each sensor has been on since last charging        event or device power on event, for each sensor that is part of        or connected to the device    -   Measured energy usage since last charging event end or most        recent device power on event, for each sensor that is part of or        connected to the device    -   Identification of which apps or services or operating system        components are installed on the device or on removable media        connected to the device or may be running on the device,        including app name, version, app vendor name, digital signature        with which the app may be signed    -   Current app or service or operating system components state        (running, quiescent, not running) and settings, for each such        item that is installed on the device or on removable media        connected to the device or may be running on the device    -   Elapsed time that each app or service or operating system        component has been running since last charging event or device        power on event, for each such item that is installed on the        device or on removable media connected to the device or may be        running on the device    -   Elapsed CPU time or network usage time for each app or service        or operating system component since last charging event or        device power on event, for each such item that is installed on        the device or on removable media connected to the device or may        be running on the device    -   Measured energy usage for each app or service or operating        system component since last charging event or device power on        event, for each such item that is installed on the device or on        removable media connected to the device or may be running on the        device    -   Current location of device (to be correlated with usage history        for presence or availability of charging devices)    -   Identification of the data or other communication limits for the        device such as monthly data usage limits.    -   Measurement of the data or other communication quantities since        the beginning of the accounting period for measuring such        quantities, or since the last charging event, or since the last        power on event, or other power-related events, including such        items as the number of communications initiated or responded to,        the number of bytes sent or received, elapsed time for        communications, measured CPU usage or power usage for the        communications, the communications technology or component or        device used, the protocols used.    -   Demographic information about the users of the device, including        but not limited to age, gender, occupation, hobbies, years of        education, and so on, and which user is the currently active        user of the device.    -   The current and recent history of whether airplane mode has been        turned on or off, or regarding the settings and switching of        other profiles.    -   The current device autolock time interval or time interval for        turning device display off; elapsed times spent in locked and        unlocked states, the number of autolock or manual lock and        unlock events.    -   Identification of SIM cards currently or recently used in the        mobile device.    -   Information about any applications which are holding any type of        operating system lock, for example, a wake lock.    -   Information about the occurrence of user level events (the        things that users do or observe, as opposed to events that        relate to the inner workings of parts of a mobile device.        Examples include the number and size of text messages sent and        their destination or received and their source; the number and        length of music songs or voice podcasts listened to, and their        source (local device storage or from a specific network source,        played by which applications); the number and length of        communications sent at the network level (packets, bytes        sent/received); the number and duration and connected numbers of        inbound or outbound voice phone calls; information about which        communication base stations have been observed, their        identifiers and technology used and signal strength, including        cell towers, Wi-Fi base stations, and so on; the number of        location requests made, the durations for which location        services were turned on and active including GPS or other        location services; the number of application related        notifications received; the number and identification of apps        that have push notifications turned on, the notification refresh        rate, the duration of time that push notification has been        turned on; settings in email or similar applications regarding        push or regarding fetch or polling or synchronization intervals,        including what those intervals are and the elapse time spent in        each state; the screen brightness settings (e.g., high, low,        auto adjustment based on lighting conditions); browser settings,        including plugins are related identifying information and        settings; settings for the use of a device LED for notifications        (on, off, blink, etc.); application level settings and counts        for things like tweets, mentions, direct messages, refresh        interval, notification on/off, synchronizing twitter data,        synchronizing contacts; RSS reader update frequencies; power or        signal level settings that a mobile device has used either when        conducting communications or when searching for connections such        as to cell towers or Wi-Fi stations (this could lead to modeled        situations with policies to turn off services while in such        areas to conserve battery but to periodically check if a        different area with different characteristics has been entered        or to switch communications mode from 4G to 3G or from dual mode        into a mode that would use less power such as GSM); current        audio notification settings such as normal ringer or vibrate or        both or silent; the number of movies or videos watched, elapsed        time, the source of the material (local or from which network        source); the number of times and the timestamps and durations of        a phone being put to sleep and awakened; information about all        applications and application services, how many times run,        elapsed time, resources used; the setting for “setting time zone        automatically” (which uses location and location change to auto        set the time zone for device but uses power to do so); which        ringtones are in use and the ringtone volume level and average        RMS level; whether a phone is rooted or not and the timestamp        when it happened; current calendar status (in a meeting, text        content, location tag for meeting), the time start and stop for        it; and for other items on the calendar for today (prior and        upcoming); count and duration of times when the mobile device        was being used for Wi-Fi tethering; the amount of CPU, network        usage, and battery related to the receiving and presenting        advertisements and counts of such events, together with        information regarding which application and ad network was used        to mediate the receipt and presentation;

The activity store 654 can store any of the things collected by theactivity monitor. In an embodiment it can also collect various historiesand statistics regarding any of those items. Examples of these itemsinclude:

-   -   Minimum, maximum, average battery usage, and other information        related to the historical or statistical distribution of battery        usage, such as standard deviation of measured battery usage, in        aggregate or broken out by time of day, or by day of week, or by        type of day (workday, weekend, holiday), or by location or        location category (e.g., home, work, commuting, etc.), or by app        or service or operating system component, or by communications        device or processor or sensor, or combination thereof    -   Historical or statistical information regarding the times of        regular charging events, in aggregate or broken out by time of        day, or by day of week, or by type of day (workday, weekend,        holiday), or by location or location category (e.g., home, work,        commuting, etc.)    -   Historical or statistical information regarding location        categories, e.g., clusters of time and location dwell times,        such as the location of home, of work, of commuting, or other        clusters which may or may not have an associated user label or        category    -   Historical or statistical information regarding the time and/or        location of the end of day event or arrival or departure from        any of the labeled or unlabeled location categories    -   Historical or statistical information regarding the time,        location, and duration of battery charging events or external        power supply events or arrival or departure from any of the        labeled or unlabeled location categories at which charging        events or external power supply events have occurred, and        information regarding the type of battery charging operation or        external power supply operation which occurred (e.g., including        the type, model, settings, and usage of battery charger or        external power supply, or fuel cell, solar cell, mechanical        power-generating means or other power sources)    -   Historical or statistical information regarding the reported        battery levels at the beginning and end of each battery charging        event or device power on event for each battery that has ever        been connected to the device    -   Historical or statistical information regarding the reported        battery levels broken out by location or location category or        time of day or day of week or combination thereof for each        battery that has ever been connected to the device    -   Historical or statistical information regarding occurrences when        battery levels have dropped to zero or below established        thresholds, broken out by location or location category or time        of day or day of week or combination thereof for each battery        that has ever been connected to the device    -   Historical or statistical information regarding battery charging        measurements made during charging events (e.g., measured in mAh        (milli Amp hours) or in Wh (Watt hours) or by Coulomb counting)        for each battery that has ever been connected to the device    -   Historical or statistical information regarding battery usage        during intervals between charging events and/or device power on        events, measured in mAh (milli Amp hours) or in Wh (Watt hours)        or by Coulomb counting) for each battery that has ever been        connected to the device    -   Historical information regarding the identification of battery        or battery type or model for each battery ever connected    -   Historical information regarding the elapsed time since        manufacture of battery (age of battery) for each battery that        has ever been connected to the device    -   Historical or statistical information regarding the elapsed        total time battery has been on while not charging, for each        battery that has ever been connected to the device, cumulative        since the manufacture of battery or for each interval between        charging events or device power on events    -   Historical or statistical information regarding the elapsed        total time battery has been on while charging, for each battery        that has ever been connected to the device, cumulative since the        manufacture of battery or for each interval between charging        events or device power on events    -   Historical or statistical information regarding the number of        charging events for each battery that has ever been connected to        the device    -   Historical record of every occurrence of a change in the current        operational status of battery charging capability, i.e., able to        charge using external power source, or unable to charge (e.g.,        due to charging system failure) for each battery that has ever        been connected to the device    -   Historical or statistical information regarding the temperature,        humidity, or moisture levels at the device or in device        components over time (internal device or device component        temperature, humidity, moisture levels, and external or ambient        temperature or humidity)    -   Historical or statistical information regarding the power draw        by device over time    -   Historical or statistical information regarding CPUs or        associated or auxiliary processors (such as GPUs or        cryptographic processors), including identification of each        processor, processor type or model, a time series of the elapsed        CPU time over time with power-related events indicated (such as        device charging event start, device charging event end, device        power off event, device power on event), the actual frequency of        operation or any special processor modes related to energy usage        such as power preserving modes

Historical or statistical information regarding the identification ofcommunication devices or components, or type of communications device orcomponent (such as radios, Wi-Fi, GPS, Bluetooth, NFC, GSM, CDMA, 3G,LTE, 2G, and others, or for optical communications such as infrared orvisible light communications, or for audio communication such aspowering internal or external speakers or microphones, or for quantumcommunications), or model for each communication device or componentthat is part of or connected to the device or ever has been part of orconnected to the device; and historical or statistical informationregarding when each of such devices have been operating, on, off, or inany of several operating modes such as standby, power-preserving mode,and using what power, with what signal strength, using what protocols,for what duration, and measurements of the amount of communication suchas bytes sent, bytes received, number of communications initiated orresponded to.

-   -   Historical or statistical information regarding the        identification of display(s) or display type (e.g., LCD or OLED        or electronic ink, or projection display, among others) or model        for each display that is part of or connected to the device or        ever has been, the time series information regarding display        settings (including brightness level, auto-brightness setting,        positive vs. negative mode, contrast level), with power-related        events indicated (such as device charging event start, device        charging event end, device power off event, device power on        event), the amount of time that each display was on, the        measured energy usage for each display.    -   Historical or statistical information regarding the        identification of audio output or input devices or types or        models for each audio output or input device that is part of or        connected to the device or ever has been, and time series        information regarding the audio output or input settings        (including volume level, microphone sensitivity), with        power-related events indicated (such as device charging event        start, device charging event end, device power off event, device        power on event), the amount of time each audio output or input        device was on, and the measured energy usage for each audio        output or input device.    -   Historical or statistical information regarding identification        of sensors (such as accelerometers, compasses, temperature        sensors, barometric pressure sensors, altitude sensors, humidity        sensors, moisture sensors, touch or pressure sensors,        orientation sensors, cameras, scanning devices, proximity        sensors, gyroscopes, ambient light sensors, chemical or odor        sensors, biometric input sensors, or medically related sensors        such as heartbeat, respiration, blood pressure, blood oxygen        levels using for example pulse oximetry, EEG sensors including        low level frequency and amplitude measurements or derived        information regarding the presence or strength of wave patterns        such as Delta, Theta, Alpha, Beta, Gamma, or Mu, or tDCS or TMS        sensors or ECG sensors) or sensors related to a device user's        gaze direction or sensor types or models for each sensor that is        part of or connected to the device or ever has been, the time        series information regarding the sensor state (on, off,        performance-saving mode) and settings, with power-related events        indicated (such as device charging event start, device charging        event end, device power off event, device power on event), the        amount of time that each sensor was on, the sensor measurements        themselves, and the measured energy usage for each display.    -   Historical or statistical information regarding the        identification of which apps or services or operating system        components are installed on the device or on removable media        connected to the device or may be running on the device or ever        have been, including app name, version, app vendor name, digital        signature with which the app may be signed, timestamp for        installation, updates, uninstallation, and time series        information regarding when each such was running in what state        and settings, elapsed time that each such was running, elapsed        CPU time or network usage time, measured energy usage with        power-related events indicated (such as device charging event        start, device charging event end, device power off event, device        power on event),    -   Historical or statistical information regarding the location of        the device over time, with power-related events indicated (such        as device charging event start, device charging event end,        device power off event, device power on event),    -   Historical or statistical information regarding the data or        other communication limits for the device such as monthly data        usage limits and time series information on the measurement of        the data or other communication quantities since the beginning        of the accounting period for measuring such quantities, or since        the last charging event, or since the last power on event, or        other power-related events, or since the beginning of accounting        time periods related to the data usage limits, including such        items as the number of communications initiated or responded to,        the number of bytes sent or received, elapsed time for        communications, measured CPU usage or power usage for the        communications, the communications technology or component or        device used, the protocols used.    -   Historical or statistical information about the user(s) of the        device, including but not limited to age, gender, occupation,        hobbies, years of education, and so on, and time series        information about which user has been an active user of the        device, with power-related events indicated (such as device        charging event start, device charging event end, device power        off event, device power on event).    -   Historical or statistical information about any applications        which have held any type of operating system lock, for example,        a wake lock, including when the lock was requested, how long the        lock was held, and whether the lock was ever relinquished.

Historically measured values related to user behavior and usage ofdevice:

-   -   Expected time until end of day    -   Expected time until next normal charging event    -   Expected time until device will next be in a location at which        charging events have occurred, where location can be an absolute        location such as user's home or work, or a relative location        such as in the user's car where charging may be possible.

In an embodiment the context knowledge discovery manager 1164 canautomatically assign a user-label property to discovered contextsituations and context behaviors. When meaningful labels can begenerated automatically for context situations and context behaviors itis easier for users and administrators to view information about contextsituations and context behaviors in the CORPS 1170, context historystore 1162, and active contexts 1166 and 1122. A set of heuristics andrules for creating compound user-label values are effective ingeneration.

E.g., the context situation with the greatest location dwell time duringthe night, where night is a duration of at least six hours in the samelocation with no significant activity on the mobile device can usuallybe labeled HOME. A context situation that has the same location as theHOME context situation and which begins with a period of inactivity ofuser interaction on the mobile device and terminates with an alarm eventcan confidently be labeled HOME-SLEEP.

For most users who are of working age, the context situation with thegreatest location dwell time during the daytime hours can usually belabeled WORK; for users of school age, such context situationsdiscovered that happen during the school year can usually be labeledSCHOOL.

Repeated geographical behaviors (frequent occurrences of similar motiontracks) can be labeled TRAVEL. When a TRAVEL context behavior begins atthe location of the HOME context situation and ends at the location ofthe WORK context situation, the behavior's user-label can be modified toCOMMUTE-HOME-TO-WORK. A TRAVEL context behavior in the other directioncan be modified to COMMUTE-WORK-TO-HOME. If the locations on the motiontrack for the TRAVEL context situation that is part ofCOMMUTE-HOME-TO-WORK coincide with externally known locations of apublic transit line such as BART in the San Francisco area, then theuser-label can be further refined to be COMMUTE-HOME-TO-WORK-VIA-BART.

A brief TRAVEL context behavior during the hours that the WORK contextsituation prevails followed by a short duration at the destination,followed in turn by substantially retracing the original TRAVEL behaviorand ending at the WORK context situation location could be labeledERRAND-FROM-WORK. If an external content service can be employed toidentify the name or category of business (e.g., a Staples store incategory OFFICE-SUPPLIES-STORE then the label could be refined toERRAND-FROM-WORK-TO-STAPLES orERRAND-FROM-WORK-TO-OFFICE-SUPPLIES-STORE.

The advantage in generating such labels automatically is that a user oradministrator does not have to assign labels or define contextsituations and context behaviors; these are discovered automaticallybased on data analysis techniques, clustering techniques, data mining,and heuristics and combining and refining rules for labels. Havinglabels on context situations and context behaviors makes policy rulesmore readable and intelligible, and explanations of actions taken bypolicies more understandable.

In another embodiment the policy manager can make certain contextbehavior predictions and changes in current behavior available toapplications that have chosen to be aware of this context managementinfrastructure. Such an application can provide enhanced functionalityto the user of the mobile device.

One example of such enhanced functionality is for a network enabledmusic player application, which fetches songs from a network source forplay on the mobile device. Such an application, although not activeduring the currently active context situation or context behavior, maybe part of a predicted context behavior. E.g., the AT-WORK contextbehavior is predicted to end in 30 minutes, and the successor contextbehavior COMMUTE-HOME-FROM-WORK predicts that the music playerapplication will be used for the duration of that event. Unfortunatelyfor the user, the motion track for the evening commute uses subwaytunnels and passes through other areas with poor network connectivity.The application can use the information from the context behaviorprediction to know that it can wake up and has 30 minutes to downloadnew music that can then be played to the user during theCOMMUTE-HOME-FROM-WORK behavior (during which time it would be unable todownload new music due to poor network connectivity). This is an exampleof context behavior prediction enabled prefetch, or more generally, acontext behavior prediction enabled pre-action.

Another example of enhanced functionality using context behaviorpredictions and context behavior changes is called postfetch, or moregenerally, a context behavior prediction enabled post-action. A typicalscenario for postfetch is when a user wants to perform an activity thatrequires network connectivity, but the user is currently in a context inwhich such an activity is going to be slow or expensive or evenimpossible. When the system detects the user attempting to initiate suchan activity while in a network-poor context, the system (or a contextmanagement infrastructure aware application) can choose to record theuser's intentions (e.g., to perform a particular network search, or tosend an email or an SMS text message), and then when the contextswitches later to one with better network connectivity, to perform theactions as indicated by the user's previously recorded intentions, andthen to notify the user that these actions have been completed. Inanother embodiment the system can simply alert the user that the user'sintended action during the current context will be slow or expensive orimpossible; the alert can include information about the historicalresource usage that is associated with performing the user's intendedaction.

Another example of enhanced functionality using context behaviorpredictions and context behavior changes is called contextualsubstitution. In one embodiment the system, or an application that isaware of the context management infrastructure, can take note of thecurrent context and make a substitution in terms of how services areperformed to accommodate the current situation. An example would be auser at work in an interior room of a large office building. In thisinterior room there is essentially no cell phone network connection dueto interference from the building structure, but there is Wi-Fiprovisioned throughout the workplace.

In this example, detecting the changed context (no cell connection, butWi-Fi available), a contextual substitution can take place to routedevice inbound or outbound phone calls or text messages via the Wi-Finetwork rather than through the normal cell connection. This may beaccomplished by a combination of actions taken on the device and onexternal services, directed by the active context policy manager.

For example, outbound phone calls could be directed to use a VOIPapplication sending call information over the available Wi-Fi network;external services could be invoked to set up call forwarding to atemporary or permanent VOIP phone number which would connect to theuser's device over the available Wi-Fi network. Contextual substitutionalso allows for selection of several alternative methods of provisioninga particular service based on current contextual considerations.

In another embodiment context information can be used for contextualrouting of communications or notifications or content in a situation inwhich a user has multiple devices (e.g., smartphone, tablet, or personalcomputer (PC)) that are being employed by the user. One aspect of thecurrent active context includes which device to which the user iscurrently attending. For example, when a device is being interacted withby the user, it is known that the user is attending to a particulardevice. When a user is interacting with one device, and a different userdevice is not in the same location, it is known that the differentdevice is not being attended to by the user. A user may be interested innotifications or information that comes into a device that is notcurrently being attended by the user.

The context management system can route the notification or informationto a device to which the user is currently attending. This can beaccomplished by the context management system, or can be handled by anapplication that is aware of the context management system. In oneexample, a user setting down the user's smartphone on the user's deskwhile begging to use the user's PC, is actively attending the PC and notthe smartphone; when an SMS text message arrives at the smartphone, thecontext management system (or an application that is aware of thecontext management system and its context information) can deliver theSMS text message or notification that it was received to the user's PC.

In another example, a user can begin using an internet-based musicplaying service on the user's smart phone. If the user sets the phonedown and picks up the user's tablet and walks away, the same applicationrunning on the user's tablet can begin to play the same song at the samepoint while the smartphone application can stop playing the song.

Another example of a policy in action is where the system has previouslyobserved a rule with high confidence that on Fridays the user does notusually plug in to recharge the device battery until around 3 a.m. Onthis Friday afternoon the system sees that the battery is at 60 percentcapacity and has a prediction that it will not last until 3 a.m. Thesystem's policy alerts and prompts the user to charge the battery now toensure that adequate battery resource will be available until theexpected usual 3 a.m. charging event.

In another embodiment applications that are aware of the contextmanagement system can enable more effective context adaptation byinforming the active context policy manager before the application takesan action as to what the action would be, including what theconfiguration parameters would preferentially be from the perspective ofthe application, and the active context policy manager disapproves theaction, or approves the action, or conditionally approves the actionwith modified configuration parameters.

In another embodiment applications that are unaware of the contextmanagement system can become context adaptive by way of thefunctionality of the context management system. For example, typicallyapplications store their configuration information and settingssomewhere on the mobile device, e.g., in a database or in a file in thefile system on the device. The active context policy manager can modifythe stored configuration information and settings based on an activecontext policy. The policies can be those that are automaticallydetermined by the context management system, or ones that have beenmanually specified by the user or an authorized administrator.

There may be different authorization rules for the specification ormodification of policies for different administrators or for the user.For example, an enterprise administrator and only an enterpriseadministrator may be authorized to modify policies that affect thefunctioning of enterprise applications that are installed on the device;or an enterprise administrator may be able to modify policies for thedevice as long as the current active context is that the device isphysically in the workplace; or the device user may be the only oneauthorized to modify policies affecting certain personal apps that theuser has installed, but the enterprise administrator may be authorizedto prevent such apps from running while in certain enterprise contexts.An example of enterprise context is while the device is connected to anenterprise network. Another example of enterprise context is while anyenterprise installed app is executing; a sample policy could be that nonon-enterprise installed apps can run concurrently with enterpriseinstalled apps, for security and data privacy reasons.

In another embodiment a context management service can use thecollective contextual information from a group of users to inform theactive context for all such users. For example, all users that are inthe same geographical location could be a context group. Communicationof the contextual information from the users (and their devices) in thecontext group could be via their devices' connections to a server/cloudbased context management system, or could be a peer to peercommunication by active context policy managers on their devices toother devices in the context group.

For some types of context information the sharing of context informationamong users in the ad hoc, geographical location based context groupcould be free and unpermissioned; for other types of context informationthe sharing of context information could require an opt-in permissionfrom the members of the context group, or at least those members whosedevices are the source of the shared context information.

Context groups may be formed by the users themselves as needed; forexample a context group for a group of friends who are going out for anevening of dining and entertainment. Context groups could be persistent,such as for family members who may wish to share their contextinformation regularly. The availability of shared contextual informationfrom a context group can improve the precision and accuracy of somemeasurements, or can make available automatic adaptations based onindividual active context situations and behaviors. For example, acontext group including friends out for an evening's entertainment, ifone of the user's device is low on battery, the context group could usecontextual substitution to direct incoming voice calls or SMS textmessages to the device of one of the other users in the context groupwho has adequate battery resource.

The act of obtaining or measuring some aspect of context may itself havean impact on context, on various resources; for example, to obtainlocation context might require the use of GPS or Wi-Fi station presenceinterrogation which in turn uses network and CPU and battery resources.In one embodiment an active policy can weigh the potential benefits fromlearning a piece of context information against the mostly known cost ofobtaining that piece of context information, and decide whether toobtain the context information or not.

In another embodiment the context management system can use contextualsubstitution of an alternative source of context information; an exampleof this would be in a context group including friends out together, itwould only be necessary for one user in the context group to have theGPS location system active on that user's device, and the GPS locationcontext information can be shared with the other users and their deviceswithin the context group. The net gain for the context group would begreatly reduced aggregate battery resource. In an embodiment the userwhose device is known to do the best job of obtaining GPS location couldbe the one so designated for use by the context group. In an embodimentthe role of which user in a context group is providing a particular typeof shared context information can rotate among the different users inthe context group, so as to minimize the resource consumption aspectwith respect to any individual user in the context group.

The historical context information that is captured in the activitystore 654 in the server/cloud management 650 service, or that iscaptured in the activity store 654 and the context history store 1162 inthe server/cloud management 1150 service, can be of great use toapplication developers, advertising networks, device and devicecomponent manufacturers, operating system providers, and communicationscarriers, for a variety of different reasons.

Such information represents realistic workloads performed by actualusers, as well as annotating that information with a rich set ofcontextual information that provides additional meaning for theinterpretation and understanding of this data. In an embodiment theaggregate contextual information that is captured is made available tosuch consumers of contextual information, either periodically in batchor in substantially real-time. Such aggregate contextual information canbe summarized, anonymized, and without any personal identifyinginformation to preserve the privacy of all the users whose contextualinformation was collected. In particular the overall aggregatecontextual information and statistics regarding it, relative to highlevel context situations and context behaviors would have great value tothose data consumers; such information is essentially impossible toobtain today.

In another embodiment the context management system is used to develop,deliver, and enforce policies for devices that are part of what has beencalled “the internet of things.” In the internet of things there aremultiple devices which operate on their own, without accompanying andattendant users. Such devices may be mobile or sessile; they may havevarious sensors and computing and communication capabilities and may runapplications; schematically they can be considered substantially similarto a mobile device 600. “Things” in the internet of things themselveshave context information, and can participate in a variety of ways in acontext management system, as mobile devices 600 or as externalenvironment resources 630. They can be managed with active contextpolicies. Such “things” may have occasional interactions with theirowners or administrators, who may monitor the things or modify settingson these things. Such owners or administrators play the role of userswith respect to the “thing” devices as far as the context managementsystem is concerned.

In another embodiment the active context policy manager could enforce apolicy that temporarily disables in-application advertisingcommunications during contexts of constrained network bandwidth orbattery charge levels.

In another embodiment the active context policy manager could perform acontextual substitution to have in-application advertisingcommunications request purely textual advertisements instead of onesusing images or animations (which could use more resources) duringcontexts of constrained network bandwidth or battery charge levels.

In another embodiment the active context policy manager could perform acontextual substitution to have in-application advertisingcommunications obtain advertisements from an already on-device cache ofadvertisements instead of obtaining them over a network during contextsof constrained network bandwidth or battery charge levels.

In another embodiment the active context policy manager could provideenriched contextual information to in-application advertising componentsto permit the connected advertising network to serve ads based on highlevel context information.

In another embodiment the active context policy manager could beenforcing a policy which restricts the amount of contextual informationthat an in-application advertising component is allowed to obtain fromeither the context management system itself or from the device'sapplications, operating system, or resources; in this embodiment thepolicy is applied to advertising components of applications, not toapplications as a whole, which requires the ability to determine whichcomponent of an application a request for context information is comingfrom.

In an embodiment a context management system communicates with aserver/cloud advertising broker, in which context information is sentfrom the device to the broker, and in which advertisements withcontextual conditions are submitted to the broker, and in which thebroker matches the current active context information from devices withthe contextual conditions submitted with advertisements, and serves thematched advertisements to the device. In this process the broker doesnot disclose the contextual information to the submitter of theadvertisement.

In an embodiment the advertisement may be submitted with not justconditional context information to be matched by the broker, but alsowith a price the submitter is willing to pay for having theadvertisement served; the broker can match devices with advertisementsbased on the combination of goodness of fit between current contextinformation and the conditional context information submitted with theadvertisement, and using information about the price the submitter iswilling to pay for having the advertisement served.

In an embodiment the device submits contextual information to the brokerwith a fee that the user of the device requires to be paid in exchangefor viewing an advertisement, and advertisements are submitted with notjust conditional context information to be matched by the broker, butalso with a price the submitter is willing to pay for having theadvertisement served; the broker can match devices with advertisementsbased on the combination of goodness of fit between current contextinformation and the conditional context information submitted with theadvertisement, and using information about the fee the device user iswilling to accept for having the advertisement served, and the price thesubmitter of the advertisement is willing to pay for having theadvertisement served.

In an embodiment the system above may have several “goodness of fit”criteria associated with multiple different fee levels (to be receivedby a device user) or multiple price levels (to be paid by the submitterof an advertisement). The broker can match devices with advertisementsbased on all of this information.

In an embodiment the device lock screen displays the current actual andprojected resource glide paths, together with information about anyactions taken automatically by the system to optimize performance, oractions taken by the system with user's approval, or actions takendirectly by the user either based on prompting or independently.Information about active policies is shown. In another embodiment asimilar display is available in an application, and the user is able todrill into details or modify policies.

In an embodiment the active state policy manager or the active contextpolicy manager takes the fewest possible number of actions that resultin an acceptable resource glide path.

In an embodiment the active state policy manager or active contextpolicy manager detects a user action (for example, launching a gameapplication); the active state policy manager can advise the user howlong the user can safely play the game before dropping the resourceglide path below acceptable levels.

In an embodiment the current active resource predictions can bepresented as notifications in the device notification area. In anotherembodiment the current active resource predictions can be presented inthe user's calendar; a time of predicted resource exhaustion can beshown at that time in the calendar; a time of recommended action (e.g.,plug device into charger) can be shown at that time in the calendar.

In an embodiment the system using machine learning can write associationrules for sets of actions that are taken by a user when a user enters aparticular context situation; the system can prompt the user who isentering a particular context situation or behavior for which thereexist high confidence association rules asking if the system should takethe set of actions that the user normally takes. In an embodiment theuser can specify that such actions should be taken automatically in thefuture when the user enters that particular context situation orbehavior. The message to the user contains the context situation labeland description. In an embodiment the set of user actions arerepresented as a policy, and added as a policy template linked to theparticular context situation or behavior.

In an embodiment the system may contain policies intended to preservecontextual privacy by specifying limits on the precision with which thecontextual information can be made available to an application or sentoff the device, or by specifying limits on the frequency with whichcontextual information can be requested, or the maximum duration duringwhich contextual information can be requested.

FIG. 19 shows an overall flow 1905 of a specific implementation of theresource prediction system. Some specific flows are presented in thisapplication, but it should be understood that the process is not limitedto the specific flows and steps presented. For example, a flow may haveadditional steps (not necessarily described in this application),different steps which replace some of the steps presented, fewer stepsor a subset of the steps presented, or steps in a different order thanpresented, or any combination of these. Further, the steps in otherimplementations may not be exactly the same as the steps presented andmay be modified or altered as appropriate for a particular process,application or based on the data.

In a step 1910, the system logs and collects mobile device usageinformation. The information can include data collected over the courseof a day (or less), week, month, or more. For example, data may becollected over a 24-hour period, 48-hour period, 72-hour period, 96-hourperiod, 120-hour period, 168-hour period, 336-hour period, or 744-hourperiod.

Data collected over a longer period can provide a more accurate usagemodel as compared to a usage model based on data collected over ashorter time period. A dataset collected over a shorter time period,however, can be used to more quickly create the usage model. Whether thedata is collected over a longer or a shorter period can depend onfactors such as the application of the system, desired accuracy,variability in the collected data, and other factors. For example, if auser's schedule and daily activities has a large degree of variabilityit may take a longer period of time to collect a sufficient amount ofdata in order to properly model the user's behavior and the variouscontexts in which the user's mobile device is used. If, however, theuser's schedule is fairly routine it can take a shorter period of timeto collect the data for the usage model.

Table A below shows an example of some of the historical usageinformation that may be collected for a particular user.

TABLE A Speed Location (miles Time/Date Activity (latitude/longitude)per hour) Oct. 7, 2011, No activity detected 37.789753, −122.457709 01:00 AM Oct. 7, 2011, No activity detected 37.789753, −122.457709 0 1:10AM Oc. 7, 2011, No activity detected 37.789753, −122.457709 0 1:20 AM .. . . . . . . . . . . Oct. 7, 2011, No activity detected 37.789753,−122.457709 0 6:20 AM Oc. 7, 2011, Movement detected 37.7911186,−122.4011706 20  6:30 AM . . . . . . . . . . . . Oct. 7, 2011, Movementdetected 37.790358, −122.3992305 22  6:40 AM Oct. 7, 2011, No activitydetected 37.7919084, −122.3986221 0 6:50 AM Oct. 7, 2011, Phone call, no37.7919084, −122.3986221 0 7:00 AM movement detected Oct. 7, 2011,Productivity 37.7919084, −122.3986221 0 7:10 AM application executing,no movement detected . . . . . . . . . . . . Oct. 7, 2011, Movementdetected 37.790358, −122.3992305 15  5:00 PM Oct. 7, 2011, Movementdetected 37.7911186, −122.4011706 18  5:10 PM Oct. 7, 2011, No activitydetected 37.789753, −122.457709 0 5:20 PM Oct. 7, 2011, No activitydetected 37.789753, −122.457709 0 5:30 PM . . . . . . . . . . . .

The entries in Table A above are periodic data samples to track theuser's use and nonuse of the mobile device. In this example, the loginterval is 10 minutes. The log interval, however, can vary. A shorterlog interval can provide a larger dataset for a more accurate model, butwill consume more resources (e.g., storage and battery power). A longerlog interval will provide a smaller dataset, but will help to conserveresources. The log interval can be configurable such as by a user orsystem administrator.

As shown in Table A above, each entry may include contextual informationsuch as a time and date stamp, a description of the activity detected, alocation of the mobile device at the time of the detection, and a speedof the mobile device at the time of detection.

In a step 1915, a contextual usage model for a user of the mobile deviceis built using the collected information. In a specific implementation,the contextual usage model is created by analyzing the data forpatterns. The patterns can be tagged or associated with a context labelor category from the context ontology. Some examples of pattern matchinginclude searching the log data for groups of consecutive entries whereno activity, movement, or both are detected, and searching entries whereactivity, movement, or both are detected.

Patterns may be identified by comparing and correlating data collectedduring one time period with data collected during another orcorresponding time period. The time period can be of any duration, canbe during any part of the day (e.g., morning, afternoon, or evening),and can be during any part of the year (e.g., fall, winter, spring, orsummer).

As an example, data collected during a weekday context may be comparedwith data collected during another weekday context to determine expecteduse of the device on a weekday. Data collected on a weekend context maybe compared with data collected on another weekend context to determineexpected use on a weekend. Data collected on the weekend context may becompared with data collected on a weekday context to determinedifferences in expected use during weekends versus weekdays. Datacollected on, for example, a Monday, may be compared with data collectedon a different Monday to determine expected use on Mondays. The data maybe cross-referenced to other sources of information. For example,location or GPS coordinate data may be cross-referenced against adatabase that maps GPS coordinates to a street address or zip code.

Identifying contexts to include in the model can be based on thefrequency that the context occurs. Contexts that occur frequently may beincluded in the model. Contexts that do not occur frequently may beexcluded or omitted from the model.

Table B below shows a subset of consecutive entries from Table A whereno activity and movement was detected.

TABLE B Location Speed (miles Time/Date Activity (latitude/longitude)per hour) Oct. 7, 2011, No activity 37.789753, −122.457709 0 1:00 AMdetected Oct. 7, 2011, No activity 37.789753, −122.457709 0 1:10 AMdetected Oct. 7, 2011, No activity 37.789753, −122.457709 0 1:20 AMdetected . . . . . . . . . . . . Oct. 7, 2011, No activity 37.789753,−122.457709 0 6:20 AM detected

The system examines the data and can make the following observations:the time and date of the entries was during the night on a weekday(e.g., Monday), the duration between the first and last entry is 5 hours20 minutes, and that the location corresponds to a residential area. Thesystem can compare the collected data with data collected for anothercorresponding time period (e.g., another Monday night). If thecomparison shows a similar pattern, based on these observations, thesystem can associate or tag the pattern with the context “HOME.”

Another example of pattern matching is to search the log data for groupsof consecutive entries where movement is detected. Table C below shows asubset of consecutive entries from Table A where movement was detected.

TABLE C Oct. 7, 2011, Movement detected 37.7911186, −122.4011706 20 6:30AM . . . . . . . . . . . . Oct. 7, 2011, Movement detected 37.790358,−122.3992305 22 6:40 AM

As discussed above, the collected data can be compared with datacollected for another corresponding time period to identify patterns.The comparison may indicate, for example, that travel started from aboutthe same location, travel ended at about the same location, the routetraveled was about the same, the speed of travel was about the same, orcombinations of these. The system may further observe that the ending ordestination location corresponds to a commercial building, the speed anddistance of travel likely indicates travel not by foot, and otherobservations. Based on the comparisons and observations, the system maytag the pattern with the context “COMMUTE-TO-WORK.”

The system can apply the pattern matching technique discussed above tothe remaining entries in Table A to identify an “AT-WORK” and“COMMUTE-HOME” context and expected device usage and non-usage duringeach context. In a specific implementation, the usage model includes aset of context situations. Each context situation includes a first timeindicating when a context situation is expected to begin, a second timeindicating when the context situation is expected to end, a location ofthe context, information indicating whether the context is expected tofall on a weekday or weekend, expected speed of travel during thecontext, expected device usage during the context, or combinations ofthese. Device usage during a particular context may include, forexample, an identification of applications used, duration of applicationusage, calls placed, calls received, duration of call, text messagessent, text messages received, text message size, and so forth.

In a step 1920, the system monitors mobile device activities. Themonitoring can include, for example, tracking the location and movementof the device, applications running on the device (e.g., time whenapplication was started, or duration of application use), the level ofbattery charge in the device, phone calls (e.g., time a phone call wasplaced, time a phone call was received, or duration of phone call),network activity (e.g., time when a network connection was established,or duration of the network connection)—just to name a few examples.

In a step 1925, the system compares the monitored activities with thecontextual usage model (step 1915) to determine any deviations betweenthe model and the activities. In a specific implementation, thecomparison includes using the monitored activities to determine acurrent context of the mobile device, identifying from the usage modelexpected usage of a resource during the current context, and comparingthe expected usage of the resource with actual usage of the resource.For example, the monitored activities may include information indicatingthat the user is traveling along a particular route. The system can usethe collected information to match or identify the current context ofthe mobile device as being “COMMUTE-TO-WORK.” The usage model canspecify the expected usage of the resource (e.g., battery) during the“COMMUTE-TO-WORK” context. The expected usage of the resource (orbattery) is compared to the actual usage of the resource to determinedeviations between expected and actual use.

In a step 1930, based on the deviations, a prediction is made about theresource to determine whether an amount of the resource will beavailable for a context following the current context as specified bythe contextual usage model. The following context may or may not be animmediately following context. For example, a usage model may include aset of contexts that are chronologically arranged as: “AT-HOME,”“COMMUTE-TO-WORK,” “AT-WORK,” “COMMUTE-TO-HOME,” and“AT-HOME-AFTER-WORK.” If the current context is “AT-WORK,” a contextafter or following the current context can be “COMMUTE-TO-HOME,” or“AT-HOME-AFTER-WORK.”

If the prediction indicates the resource amount will not be sufficientfor the following context, the system reduces use of the resource (step1935). If the prediction indicates the resource amount will besufficient for the following context, the system does not reduce use ofthe resource (step 1940).

More particularly, a deviation may indicate that actual usage of theresource is higher than expected. The user may have made severalunexpected phone calls during the current context. For example, the“COMMUTE-TO-WORK” context may have information indicating that no phonecalls are expected during the context.

On this particular occasion, however, the user may have made a number ofphone calls while commuting to work. These unexpected phone calls mayhave consumed an amount of battery charge such that the charge levelwill be insufficient to support the activities during the followingcontext (e.g., “AT-WORK”). So, the system can reduce resource usage(step 1935) so that the resource will be available for the “AT-WORK”activities. In a specific implementation, reducing usage of the resource(e.g., battery) is by activating one or more resource reduction policiesthat specify actions to take on the device in order to conserve theresource.

Alternatively, a deviation may indicate that actual usage of theresource is lower than expected. For example, the model may specify thatduring the current context (e.g., “COMMUTE-TO-WORK”) the user isexpected to use a particular application.

On this particular occasion, however, the user may not have used theapplication. So, the amount of battery charged that was expected to beconsumed through use of the application will not have been consumed.Thus, there may be a surplus. Usage of the resource will not have to bereduced (step 1940).

When there is a surplus, a policy may be activated that increases usageof the resource. For example, a service that may have been disabled,such as a non-priority or non-essential location service, may be enabledso that the user can enjoy the benefits of the location service with theassurance that the battery charge-level will be sufficient to supportthe activities of the following context (e.g., “AT-WORK”). Activatingdevice features when there is a surplus of battery power lets the userenjoy the full potential of the device.

For example, message notification frequency may be initially set at along duration in order to conserve battery power. When there is asurplus, however, the notification frequency can be set to a shorterduration so that the notifications are more up-to-date. As anotherexample, GPS tracking may initially be disabled in order to conservebattery power. If, however, there is a surplus, GPS tracking may beenabled so that the user receives the benefits of location-basedservices.

As shown by loops 1945 and 1950, the system can continuously monitoractivities, make estimates and re-estimates, compare the actual resourceusage with the expected resource usage of the context, and make resourceadjustments as needed so that the resource will be available for thefollowing context as specified by the contextual usage model.

FIG. 20 shows a specific implementation of a flow 2005 for the resourceglide path shown in FIG. 10. In a step 2010, the system analyzes thecontextual usage model of the user to determine a first time after whichit will be acceptable for a battery of the mobile device to fall below athreshold charge level. The threshold charge level can be the level ofcharge in the battery at which the mobile device will no longer operate(e.g., will not turn on) or automatically shuts down. In a specificimplementation, the system scans the context situations listed in theusage model to identify the context situations where the mobile deviceis expected to be connected to a charger.

A charger is a device used to put energy into a battery by pushing anelectric current into the battery. Depending upon the type of charger, acharger may be adapted to connect to an alternating current (AC)electrical socket such as may be found in one's home or a building, adirect current (DC) electrical socket such as may be found in acigarette lighter receptacle of an automobile. A mobile device may becharged through a charging kiosk or station such as may be found at anairport.

As an example, the context “AT-HOME” may include information indicatingthat the user charges the mobile device while they are home. Uponidentifying the context, the system determines the expected startingtime of the context. In this example, the context “AT-HOME” may includeinformation indicating that the user is expected to arrive home at about7:00 p.m. (see FIG. 10). In this example, the first time is 7:00 p.m. Inother words, after 7:00 p.m. it will be acceptable for the battery tofall below a threshold charge level or be exhausted because the userwill have arrived at their home and have access to a charger.

Thus, in an implementation, a context in which it may be acceptable forthe battery to fall below the threshold charge level is when the contextspecifies the presence of a charger. As an example, if the usertypically charges the mobile device while at home then the acceptablecontext may be “AT-HOME.” If the user typically charges the mobiledevice while at work then the acceptable context may be “AT-WORK.” Ifthe user typically charges the mobile device while commuting, such as intheir car, then the acceptable context may be “COMMUTING-VIA-CAR.” Therecan be multiple acceptable contexts. In another specific implementation,the acceptable context may be based on the user being in the presence ofother acquaintances (e.g., spouse, relatives, friends, associates, orcolleagues) who have mobile devices. In these cases, it may beacceptable for the battery to fall below the threshold charge levelbecause the user may be able to rely on, for example, their spouse'smobile device.

In a step 2015, the system examines current usage of the mobile deviceto predict a second time at which the battery will fall below thethreshold charge level (see reference number 1070—FIG. 10). In aspecific implementation, the prediction includes analyzing a set of datapoints, each data point corresponding to a specific charge level of thebattery measured at a specific time.

In a specific implementation, the analysis includes an interpolation ofthe data points in order to estimate the second time. The interpolationcan be a linear interpolation as shown in FIG. 10. It should beappreciated, however, that other types of interpolation or estimationmay instead or additionally be used. Other examples of interpolation orapproximation methods that may be suitable include piecewise constantinterpolation or nearest-neighbor interpolation, polynomialinterpolation, spline interpolation, a Gaussian process, rationalinterpolation, trigonometric interpolation, Whittaker-Shannoninterpolation, multivariate interpolation, bilinear interpolation,bicubic interpolation, trilinear interpolation, or least squares—just toname a few examples. In the example shown in FIG. 10, the battery ispredicted to fall below the threshold charge level at the estimatedsecond time of 4:00 p.m.

In a step 2020, if the second time is before the first time, the systemreduces usage of the battery. In the example shown in FIG. 10, thesecond time (i.e., 4:00 p.m.) is before the first time (i.e., 7:00p.m.). In a specific implementation, reducing usage of the batteryincludes activating a resource reduction policy to take actions on themobile device as discussed in this patent application.

In a specific implementation, calculating the second time is based on amost recent charge of the battery. If, for example, the battery wascharged (either fully or partially charged) after the second time hadbeen calculated, then the second time may be recalculated. This helps toensure a good estimate for the second time because the calculation willbe based the state of the battery as of the last charging session.

The first time may be recalculated if the system detects a change in thecontexts upon which the first time was originally calculated. Forexample, the first time may have been calculated based on the assumptionthat the user will return home by 7:00 p.m. Consider, however, that onthis particular occasion, the user is working late. The system candetect that the user has not left the office at the expected time (e.g.,6:30 p.m.) and may then recalculate the first time. For example, thefirst time may originally have been calculated to be 7:00 p.m., but maybe recalculated to be 9:00 p.m. (e.g., the new estimate for when theuser is expected to arrive home).

Interpolation and estimates can be subject to errors. In a specificimplementation, the trigger for reducing battery usage is when thesecond time is more than a predetermined amount of time before the firsttime. The amount of time can be user-configurable. For example, the usercan configure the time to be 0, 5, 10, 15, 20, 25, or 30 minutes, or anyother value as desired. In a specific implementation, battery usage isreduced if the second time is at least a predetermined amount of timebefore the first time. The predetermined amount of time can be a settingof the system that is managed by the user. Having a predetermined amountof time can help to prevent the policy from being activated prematurely.

FIG. 21 is a block diagram showing some of the actions or consequencesof activating a policy to reduce usage of a resource such as a battery.As discussed above, policy activation 2105 can include disabling aservice on the mobile device 2110, providing the user with a suggestionon how to reduce usage 2115 (e.g., displaying a message on theelectronic screen of the device with a recommendation to turn-off WiFi),prompting the user for permission to reduce usage before reducing usage2120, reducing usage automatically 2125 (i.e., without prompting theuser for permission), changing a setting on the mobile device 2130,providing a substitute service 2135, providing cached information (seeFIG. 22), or combinations of these.

Actions to reduce resource usage can be prioritized such as based on theimportance of the service. For example, if WiFi connectivity is lessimportant than checking email every 5 minutes, then WiFi may be disabledbefore email checking.

As discussed above, in some embodiments, a server is used to help manageresources on the mobile device. Thus, reducing usage can includetransmitting from the server to the mobile device instructions to changea device setting, e.g., change a setting from a first value to a secondvalue, where when the setting is at the second value less of the batteryis consumed that when the setting is at the first value. Reducing usagecan include substituting services provided by a first applicationprogram currently running on the device with services provided by asecond application program not currently running on the device, wherethe second application program consumes less of the battery than thefirst application program.

FIG. 22 shows a flow 2205 for providing cached information such ascached location information in order to conserve resources. In brief, ina step 2210, the system stores a location of the mobile device. Thelocation may be GPS coordinates acquired from a GPS receiver of thedevice that indicate a geographical location of the mobile device. In astep 2215, the system intercepts a request from an application programfor a current location of the mobile device. The request may includeinstructions to activate the GPS receiver and acquire the currentlocation. In a step 2220, the system determines that an elapsed durationbetween a time of the request and a time when the location was stored iswithin a threshold period. In a step 2225, in response to the requestfrom the application program for the current location, the systemprovides the previously stored location.

The amount of power consumed by a GPS receiver can be significant. Forexample, power is needed for the device antenna and power is needed forcapturing and processing the satellite signals for triangulatingposition. Intercepting the request prevents the GPS receiver from beingactivated and conserves battery power. Comparing the elapsed durationbetween the time of the request and the time the location was storedwith a threshold time period helps to ensure that the stored locationinformation is not too stale. For example, if the elapsed duration wasmerely several seconds, then the previously stored location may besufficiently accurate for the requesting application. The threshold timeperiod can range from about 5 seconds to about 5 minutes. The timeperiod can be less than 5 seconds or greater than 5 minutes.

In a specific implementation, the threshold time period variousdepending upon context. For example, if the user is traveling at a lowrate of speed (e.g., walking) the threshold time period may be longer ascompared to when the user is traveling at a high rate of speed (e.g.,driving). Thus, good location accuracy can be provided when the user'sposition is changing quickly (e.g., user is driving). Conversely, if theuser's position is not changing quickly (e.g., user is walking) then thepreviously stored location information may be a reasonable approximationof the user's current location and battery power can be conserved by notactivating the GPS receiver.

In a specific implementation, the system provides for the discovery, viaanalysis by the activity knowledge discovery manager, of the effectsthat different application or device settings can have on resourceusage, including network bytes sent/received, cpu processor cycles,battery charge used, etc., via the collection of information frommultiple devices (including ones not owned by the user).

For example, first information may be collected from a first mobiledevice of a first user. Second information may be collected from asecond mobile device of a second user, different from the first user.The first and second information is analyzed to make a discoveryregarding a resource on the first mobile device.

In some cases, information may be collected from multiple devicesbelonging to the same user in order to create a usage model. In aspecific implementation, a method includes collecting first informationfrom a first mobile device of a user, collecting second information froma second mobile device, different from the first mobile device, of theuser, and analyzing the first and second information to create acontextual usage model for the user.

In a specific implementation, resource glide path processing can beconfigured for resources other than battery power, such as monthly datalimits. For example, a first value indicating a monthly data limit for aparticular month is obtained. The system predicts a second value thatestimates an amount of data to be used during the particular month. Ifthe second value is greater than the first value, a policy is activatedto reduce network data usage.

In a specific implementation, a system provides for the use of theontology and ontology related processing of low level data intohigh-level data, and the specification of policy templates based onthese abstracted conceptual context situations and behaviors. Theconstruction of context situations can be from observations made fromcollection of data; e.g., theUSING-EMAIL-APP-WHILE-COMMUTING-TO-WORK-FROM-HOME-VIA-BART example.

In a specific implementation, a system provides for the discovery andcreation of context behaviors (sequences of context situations) fromobserved data and the automatic labeling of context situations andbehaviors. As discussed above, in a specific implementation,context-awareness is used to intelligently manage the mobile devicebattery. In another specific implementation, context-awareness is usedto adapt the mobile device to a current context. Based on the currentcontext, the home page screen of the device may display some icons, buthide or not display other icons. For example, if the current contexthappens to be “AT-WORK,” the home screen may not display mobileapplications related to games, but may instead display applicationsrelated to business productivity. This can help reduce the appearance ofclutter on the home screen.

In a specific implementation, a method includes displaying on a homescreen of a mobile device a first set of application icons when themobile device is in a first context, detecting that the mobile device iscurrently in a second context, different from the first context, andupon the detecting, displaying on the home screen a second set ofapplication icons, different from the first set of application icons.The first set of application icons may belong to a first category ofmobile applications (e.g., games or entertainment). The second set ofapplication icons may belong to a second category of mobile applications(e.g., business productivity). A number of application icons in thefirst set may be different or the same as a number of application iconsin the second set. For example, the user may have installed more gamesas compared to business productivity applications.

As another example, when the user is at the theater, the mobile devicemay automatically be configured to vibrate so as to not disturb othertheater patrons when the user receives a call. In another specificimplementation, a method includes permitting an option of the mobiledevice to remain at a first setting while the mobile device is in afirst context, detecting that the mobile device is currently in a secondcontext, different from the first context, and up on the detecting,changing the option to a second setting, different from the firstsetting. The option may be, for example, a ringer. The first setting mayto enable ringing, and the second setting may be to enable vibration.The first context may be “COMMUTE.” The second context may be “THEATER.”

In a specific implementation, modification of resource-usage policiescan be by administrators, parents, etc. A “reserve” in resource usagemay be provided to allow the completion of a certain number ofactivities of certain types, e.g., “can make at least one phone call of3 minutes duration”).

In a specific implementation, the system uses information about thestructural relationship amongst different resources to optimize orimprove resource usage; e.g., CPU processor activity consumes a certainamount of battery power; thus a policy template goal to reduce batteryusage can accomplish this by choosing a policy action which reduces CPUprocessor activity (which, by the modeled or discovered (via datamining) structural relationship between CPU processor activity andbattery power consumption, will therefore reduce battery powerconsumption).

In a specific implementation, the system provides for the use of anexternal context-enhancement service to obtain additional informationwhich can be used to select appropriate policy templates for activation;ref., e.g., the example of using a context enhancement service to takeGPS coordinates and obtain information about the geophysical locationthat this is a particular movie theater, which in the ontology ismodeled as a conceptual MOVIE-THEATER which inherits properties fromparent concept node PERFORMANCE-VENUE, which may have associated with ita set of policy templates which can be activated when the user's currentcontext is a PERFORMANCE-VENUE (e.g., turn phone ringer from ring tovibrate, turn off WiFi and GPS services).

In a specific implementation, a system provides for the use of{context-situation discovery, context-behavior discovery} and datamining based frequency analysis to surface/discover frequently occurringcontexts for which an administrator can author policy templates andattach them to those particular contexts.

In a specific implementation, a system provides mined context situationsand context behaviors to third parties, for their use in, e.g., modelingtypical user workloads on devices in typical situations, for thepurposes of optimizing or improving the design of device features andapplications. For example, the system can make context situationsavailable through an API or software development kit (SDK).

In a specific implementation, a system provides for the usage of plannedfuture events (e.g., from a user's calendar) to inform the resourceprediction method about (a) likely future resource usage, and (b)opportunities for resource reduction during such events, and (c)anomalous extensions to the usual context behaviors (e.g., user hasconcert tickets tonight at 8 pm and thus won't be at home where abattery charger is even though that's the normal context behavior forthis user).

In a specific implementation, a system provides for context behavioradaptation via prefetch (e.g., the music player example), contextbehavior adaptation via postfetch (as per example discussed above), andcontext behavior adaptation via substitution (see the example above ofarranging VOIP switchover for voice calls).

In a specific implementation, a system provides for use of knowledgeabout which device a user is currently attending (paying attention to)to drive decisions about which resource conservation actions may beacceptable. In a specific implementation, a system provides for servingads based on context situations and context behaviors, including theanonymity of ad matching, the auction for ad matching to contexts, etc.In a specific implementation, a system provides for optimizing orprioritizing the choice of what set of active policy templates can beused to achieve a particular goal. In a specific implementation, asystem provides for privacy preservation regarding the use anddissemination of context information.

In the description above and throughout, numerous specific details areset forth in order to provide a thorough understanding of an embodimentof this disclosure. It will be evident, however, to one of ordinaryskill in the art, that an embodiment may be practiced without thesespecific details. In other instances, well-known structures and devicesare shown in block diagram form to facilitate explanation. Thedescription of the preferred embodiments is not intended to limit thescope of the claims appended hereto. Further, in the methods disclosedherein, various steps are disclosed illustrating some of the functionsof an embodiment. These steps are merely examples, and are not meant tobe limiting in any way. Other steps and functions may be contemplatedwithout departing from this disclosure or the scope of an embodiment.

We claim:
 1. A method, comprising: monitoring, by a server, currentactivities of a mobile communications device in use by a first user,including determining an actual rate of usage and a current availablelevel for a first resource of the mobile communications device;selecting, by the server, a first stored context from a data storestoring a plurality of contexts of use of the mobile communicationsdevice by the first user, the selection from among the plurality basedupon the first user's monitored current activities of the mobilecommunications device, each stored context including a modeling of afirst expected context behavior and a second expected context behaviorof the first user, wherein the second expected context behavior issubsequent in time to the first expected context behavior, and whereineach of the first and second expected context behaviors is a sequence ofcontext situations or a combination of context situations, each contextsituation describing a single activity involving usage of resources andcomponents of the mobile communications device, the resources andcomponents including one or more of internal resources, applications,operating systems, external resources, and environmental factorsincluding one or more of date, time, and locations of the mobilecommunications device; determining, by the server, an expected rate ofusage of the first resource for the usage of the first resource for thefirst ex acted context behavior with the actual rate of usage of thefirst resource during the monitored current activities of the mobilecommunications device in use by the first user; when the comparisonshows that the actual rate of usage of the first resource is higher thanthe expected rate of usage of the first resource; determining, by theserver, a first point in time for exhaustion of the first resource ofthe mobile communications device based on the second expected contextbehavior associated with the selected first stored context of the mobilecommunications device; determining, by the server, a second point intime for exhaustion of the first resource of the mobile communicationsdevice based on the current available level and the actual rate of usageof the first resource of the mobile communications device as indicatedby the monitored current activities; and reducing usage of the firstresource by the mobile communications device when the second point intime is prior to the first point in time such that the mobilecommunications device is able to continue operating while using thefirst resource until at least the first point in time.
 2. The method ofclaim 1, the reducing step further comprising: transmitting instructionsfrom the server to the mobile communications device to change a settingon the mobile communication device from a first value to a second value,wherein the mobile communication device consumes less of the firstresource when the setting is at the second value than when the settingis at the first value.
 3. The method of claim 1, the monitoring stepfurther comprising: evaluating, by the server, the current activities ofthe mobile communications device over time to develop the plurality ofcontexts for use of the mobile communications device by the first user.4. The method of claim 3, wherein each context represents a differentstate of operation for the mobile communications device.
 5. The methodof claim 1, further comprising: incorporating a reserve into thedetermination of the first point in time, wherein the reserve providesadditional usage of the first resource for limited operation beyond thefirst point in time.
 6. The method of claim 5, wherein the firstresource is battery power.
 7. The method of claim 1, the reducing stepfurther comprising: transmitting instructions from the server to themobile communications device in accord with a resource usage policy, theinstructions specifying steps for the mobile communications device totake to reduce usage of the first resource.
 8. The method of claim 7,wherein the resource usage policy is selected based on the contextmodel.
 9. The method of claim 8, further comprising: in accord with theresource usage policy, modifying settings for at least one of theinternal resources, the applications, the operating systems, or theexternal resources of the mobile communications device.
 10. The methodof claim 9, wherein the modifying step is performed automatically. 11.The method of claim 9, wherein the modifying step is performed afterobtaining user approval.
 12. The method of claim 9, wherein the resourceusage policy is implemented in an application by linking the applicationto an external library.
 13. A method, comprising: monitoring, by amobile communications device, current activities of the mobilecommunications device in use by a first user, including an actual rateof usage and a current available level for a first resource of themobile communications device; selecting, by the mobile communicationsdevice, a first stored context from a data store storing a plurality ofcontexts of use of the mobile communications device by the first user,the selection from among the plurality based upon the first user'smonitored current activities of the mobile communications device, eachstored context including a modeling of a first expected context behaviora second expected context behavior of the first user, wherein the secondexpected context behavior is subsequent in time to the first expectedcontext behavior, and wherein each of the first and second expectedcontext behaviors is a sequence of context situations or a combinationof context situations, each context situation describing a singleactivity involving usage of resources and components of the mobilecommunications device, the resources and components including one ormore of internal resources, applications, operating systems, externalresources, and environmental factors including one or more of date,time, and locations of the mobile communications device; determining, bythe mobile communications device, an expected rate of usage ofcommunications device, the expected rate of usage of the first resourcefor the first expected context behavior with the actual rate of usage ofthe first resource during the monitored current activities of the mobilecommunications device in use by the first user; when the comparisonshows that the actual rate of usage of the first resource is higher thanthe expected rate of usage of the first resource; predicting, by themobile communications device, a first point in time for exhaustion ofthe first resource of the mobile communications device based on thesecond expected context behavior associated with the selected firststored context of the mobile communications device; predicting, by themobile communications device, a second point in time for exhaustion ofthe first resource of the mobile communications device based on thecurrent available level and the actual rate of usage of the firstresource of the mobile communications device as indicated by themonitored current activities; and reducing usage of the first resourceby the mobile communications device when the second point in time isprior to the first point in time such that the mobile communicationsdevice is able to continue operating while using the first resourceuntil at least the first point in time.
 14. The method of claim 13, thereducing step further comprising: executing instructions in accord witha resource usage policy stored on the mobile communications device, theinstructions specifying steps for the mobile communications device totake to reduce usage of the first resource.
 15. The method of claim 13,the reducing step further comprising: executing instructions stored onthe mobile communications device to change a setting on the mobilecommunication device from a first value to a second value, wherein themobile communication device consumes less of the first resource when thesetting is at the second value than when the setting is at the firstvalue.
 16. The method of claim 13, the monitoring step furthercomprising: evaluating, by the mobile communications device, the currentactivities of the mobile communications device over time to develop theplurality of contexts for use of the mobile communications device by thefirst user.
 17. The method of claim 16, wherein each context representsa different state of operation for the mobile communications device. 18.A system, comprising: an activity monitor configured to collect contextinformation from a plurality of context elements for a digital deviceused by a first user, each context element corresponding to a source ofcontext information regarding usage of resources and components of thedigital device; the resources and components including one or more ofinternal resources, applications, operating systems, external resources,and environmental factors including one or more of date, time; andlocations of the digital device; an activity store for storing thecollected context information; a knowledge discovery manager configuredto; (i) evaluate an active set of the context elements to identify atleast one active context situation, the active context situationdescribing a current activity involving usage of the resources andcomponents of the digital device, (ii) predict a first expected contextbehavior for the first user of the digital device based on theidentified active context situation, the first expected context behavioris one of a plurality of expected context behaviors defined for thefirst user, including a second expected context behavior that issubsequent to the first expected context behavior, each of the expectedcontext behaviors is as a sequence of context situations or acombination of context situations, each context situation describing asingle activity involving usage of resources and components of themobile communications device, including internal resources,applications, operating systems, external resources, and environmentalfactors including date, time, and locations of the mobile communicationsdevice; (iii) predict an expected rate of usage of a first resource ofthe digital device for the first expected context behavior, and (iv)compare the expected rate of usage of the first resource for the firstexpected context behavior with an actual rate of usage of the firstresource; when the comparison shows that the actual rate of usage of thefirst device for the first predicted active context behavior,predicting, by the mobile communications device a second expected rateof usage of the first resource for the second active context behavior;and context store for storing the plurality of expected contextbehaviors defined for the first user; and a context manager configuredto apply a resource usage policy for the first resource to the digitaldevice based on the predicted second expected rate of usage for thesecond active context behavior, the resource usage policy havinginstructions to configure properties or settings of the internalresources, the applications, the operating systems, or the external ofthe digital device in order to complete the predicted second activecontext behavior without exhausting the first resource.
 19. The systemof claim 18, further comprising: a context ontology store coupled to thecontext manager, the context store, and the activity store, for storinginformation regarding the internal resources, the applications, theoperating systems and the external resources of the digital device. 20.The system of claim 19, wherein: the context manager processesinformation from the activity store, the context store, and the contextontology store in order to modify the usage policy to reduce consumptionof the first resource for at least one of the internal resources, theapplications, the operating systems, or the external resources.
 21. Thesystem of claim 19, wherein: the knowledge discovery manager predicts asubsequent context behavior for the digital device; and the contextmanager applies the usage policy to reduce consumption of the firstresource when the subsequent context behavior indicates that the firstresource will be exhausted before the active context behavior iscompleted.
 22. The system of claim 19, wherein: the knowledge discoverymanager evaluates a plurality of active context situations over time;the context manager defines an expected context behavior model for thefirst user of the digital device, the expected context behavior modelhaving a plurality of predicted context behaviors, each predictedcontext behavior comprising a different sequence or combination ofactive context situations; the context manager compares the activecontext behavior to a predicted context behavior; and the contextmanager applies the usage policy to reduce consumption of the firstresource when the active context behavior will exhaust the firstresource faster than the predicted context behavior.
 23. The system ofclaim 22, wherein: the context store has a plurality of usage policiesstored therein, each usage policy corresponding to at least one contextbehavior; and the context manager applies the usage policy correspondingto the active context behavior.
 24. The system of claim 23, wherein: thecontext manager applies the usage policy to the digital device byembedding an executable instruction into at least one of the internalresources, the applications, the operating systems or the externalresources.
 25. The system of claim 23, wherein: the context managerapplies the usage policy to the digital device by dynamically attachingto at least one of the internal resources, the applications, theoperating systems or the external resources.
 26. The system of claim 19,wherein: the digital device is a mobile communications device, and theactivity monitor, the activity store, the knowledge discovery manager,the active context store, the context manager, and the context ontologystore are implemented on the mobile communications device.
 27. Thesystem of claim 19, further comprising: a server; and the digital deviceis a mobile communications device, wherein the activity monitor, theactivity store, the knowledge discovery manager, the context store, thecontext manager, and the context ontology store are implemented on theserver with a corresponding client part implemented on the mobilecommunications device.